From 2fcf938df758455afe91303fe4dcc9b074a069ac Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Mon, 5 Jun 2017 19:12:40 +0100 Subject: [PATCH] more tests --- test/batching.jl | 10 ++++++++-- test/runtests.jl | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/batching.jl b/test/batching.jl index 59a57bcc..a68b9d6c 100644 --- a/test/batching.jl +++ b/test/batching.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 7e949956..8dd1dd8e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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