This commit is contained in:
boathit 2018-08-23 16:01:42 +08:00
parent 5dca80bd68
commit 33c901c191
2 changed files with 1 additions and 7 deletions

View File

@ -24,7 +24,7 @@ julia> chunk(1:10, 3)
"""
chunk(xs, n) = collect(Iterators.partition(xs, ceil(Int, length(xs)/n)))
batchindex(xs, i) = (reverse(Base.tail(reverse(axes(xs))))..., i)
batchindex(xs, i) = (reverse(Base.tail(reverse(indices(xs))))..., i)
"""
frequencies(xs)

View File

@ -90,9 +90,3 @@ end
m = RNN(10, 5)
@test size.(params(m)) == [(5, 10), (5, 5), (5,), (5,)]
end
@testset "batch" begin
xs = [[1,2,3],[4,5,6]]
X = [1 4; 2 5; 3 6]
@test batch(xs) == X
end