more tests

This commit is contained in:
Mike J Innes 2017-06-05 19:12:40 +01:00
parent bf3db99bc1
commit 2fcf938df7
2 changed files with 9 additions and 3 deletions

View File

@ -1,11 +1,17 @@
using Flux.Batches, Base.Test
@testset "Batching" begin
bs = Batch([[1,2,3],[4,5,6]])
@test typeof(bs) <: Batch
@test bs == [[1,2,3],[4,5,6]]
@test rawbatch(bs) == [1 2 3; 4 5 6]
batchseq = Batch([Seq([[1,2,3],[4,5,6]]),Seq([[7,8,9],[10,11,12]])])
@test batchseq == [[[1,2,3],[4,5,6]]]
@test rawbatch(batchseq)[1,1,3] == 3
@test rawbatch(batchseq)[2,2,1] == 10
end

View File

@ -1,4 +1,4 @@
using Flux, Flux.Batches, DataFlow, MacroTools, Base.Test
using Flux, DataFlow, MacroTools, Base.Test
using Flux: graph, Param, squeeze, unsqueeze, back!, update!, flatten
using DataFlow: Line, Frame