Flux.jl/test/batching.jl

18 lines
367 B
Julia
Raw Normal View History

2017-06-05 18:12:40 +00:00
using Flux.Batches, Base.Test
2017-02-23 22:40:07 +00:00
@testset "Batching" begin
2017-02-20 19:34:57 +00:00
bs = Batch([[1,2,3],[4,5,6]])
@test bs == [[1,2,3],[4,5,6]]
@test rawbatch(bs) == [1 2 3; 4 5 6]
2017-02-23 22:40:07 +00:00
2017-06-05 18:12:40 +00:00
batchseq = Batch([Seq([[1,2,3],[4,5,6]]),Seq([[7,8,9],[10,11,12]])])
2017-06-05 18:16:24 +00:00
@test batchseq == [[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]]
2017-06-05 18:12:40 +00:00
@test rawbatch(batchseq)[1,1,3] == 3
@test rawbatch(batchseq)[2,2,1] == 10
2017-02-23 22:40:07 +00:00
end