Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2014-06-30 23:22:55 +0400
committerSoumith Chintala <soumith@gmail.com>2014-06-30 23:22:55 +0400
commitf32f33b49680a6bda36e13c4a8ada2e11ef61496 (patch)
tree7c9d011b3a35e799d58e802c2e5e77a6eb351f73 /test
parent54a9476ca762ce647eb05437661a5a9415949e11 (diff)
parentddfe535a7900939136f40773847f5b1152643a2a (diff)
Merge pull request #24 from sergomezcol/master
Add mini-batch support for nn.View
Diffstat (limited to 'test')
-rw-r--r--test/test.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 5e4bce7..88adf96 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1884,6 +1884,13 @@ function nntest.View()
mytester:assertTableEq(module:forward(minibatch):nElement(),
minibatch:nElement(),
"Error in minibatch nElement")
+ local module = nn.View(-1):setNumInputDims(1)
+ mytester:assertTableEq(module:forward(minibatch):size(1),
+ minibatch:size(1),
+ "Error in minibatch dimension with size -1")
+ mytester:assertTableEq(module:forward(minibatch):nElement(),
+ minibatch:nElement(),
+ "Error in minibatch nElement with size -1")
end
-- Define a test for SpatialUpSamplingCuda