diff options
author | ivpopov <ivpopov@google.com> | 2016-02-03 19:08:42 +0300 |
---|---|---|
committer | ivpopov <ivpopov@google.com> | 2016-02-03 19:08:42 +0300 |
commit | 846bf44460cda72b1e306eb8250577ba341b06f3 (patch) | |
tree | 36b8d862a522083a0dbf9052523ef36b6287ed5a | |
parent | 2caa6e9d30f3a73f67692ef6bcfa9529162069bd (diff) |
Added test
-rw-r--r-- | test/test.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua index 48c5a81..6272344 100644 --- a/test/test.lua +++ b/test/test.lua @@ -221,6 +221,15 @@ function cudnntest.SpatialConvolution_backward_single() test(sconv, gconv) end +function cudnntest.SpatialConvolution_batch_reshape() + local gconv = cudnn.SpatialConvolution(4, 8, 4, 4, 2, 2):cuda() + local outputBatch = gconv:forward(torch.rand(1, 4, 32, 32):cuda()) + mytester:asserteq(outputBatch:dim(), 4, 'error in dimension') + + local outputNoBatch = gconv:forward(torch.rand(4, 32, 32):cuda()) + mytester:asserteq(outputNoBatch:dim(), 3, 'error in dimension') +end + function cudnntest.VolumetricConvolution_forward_single() local from = math.random(1,16) local to = math.random(1,16) |