fix argmax and batch deprecations

This commit is contained in:
boathit 2018-08-23 13:17:58 +08:00
parent 616ed194df
commit 5dca80bd68
2 changed files with 7 additions and 1 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(indices(xs))))..., i)
batchindex(xs, i) = (reverse(Base.tail(reverse(axes(xs))))..., i)
"""
frequencies(xs)

View File

@ -90,3 +90,9 @@ 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