remove iterators

This commit is contained in:
Mike J Innes 2017-06-06 18:03:14 +01:00
parent 66c0403ffd
commit 72e8e5c7f9
2 changed files with 1 additions and 10 deletions

View File

@ -1,5 +1,4 @@
julia 0.6.0-pre
Iterators
DataFlow
Juno
MacroTools 0.3.3

View File

@ -22,15 +22,7 @@ onecold(y::AbstractVector, labels = 1:length(y)) =
onecold(y::AbstractMatrix, l...) =
squeeze(mapslices(y -> onecold(y, l...), y, 2), 2)
using Iterators
import Iterators: Partition, partition
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))
chunk(xs, n) = _partition(xs, length(xs)÷n)
chunk(xs, n) = Base.Iterators.partition(xs, length(xs)÷n)
batches(xs...) = (Batch(x) for x in zip(xs...))
sequences(xs, len) = (Seq(x) for x in partition(xs, len))