From 9921881d47644395612903fcd5fd0cba5b954214 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Thu, 23 Feb 2017 23:40:22 +0000 Subject: [PATCH] fixes apparently needed for 0.6 --- src/data.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data.jl b/src/data.jl index d63cd9ad..d280c9d1 100644 --- a/src/data.jl +++ b/src/data.jl @@ -24,11 +24,11 @@ possible values, and produces the appropriate value. onecold(pred, labels = 1:length(pred)) = labels[findfirst(pred, maximum(pred))] using Iterators -import Iterators: partition +import Iterators: Partition, partition export partition -Base.length(l::Iterators.Partition) = length(l.xs) ÷ l.step +Base.length(l::Partition) = length(l.xs) ÷ l.step _partition(r::UnitRange, step::Integer) = (step*(i-1)+1:step*i for i in 1:(r.stop÷step)) _partition(xs, step) = (xs[i] for i in _partition(1:length(xs), step))