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
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2015-04-22 23:49:13 +0300
committerSoumith Chintala <soumith@gmail.com>2015-04-22 23:49:13 +0300
commit394554a8440725e5fd53664fbff675ee567d0fae (patch)
tree5426016aa2f3f4c798e845c77aed79bfb26eb639 /test.lua
parentdbfeab9b7d48c0c6cd7024dd36b8d2badd275759 (diff)
parent0063dbdefd77182c9235315d5574caf7bbf25147 (diff)
Merge pull request #240 from torch/fixview
fix View (hopefuly)
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test.lua b/test.lua
index e0afbbb..7eb76a2 100644
--- a/test.lua
+++ b/test.lua
@@ -2872,6 +2872,17 @@ function nntest.View()
minibatch:size(1),
"Error in minibatch dimension with size -1")
+ -- another setNumInputDims case
+ local minibatch = torch.rand(2,5,4,10)
+ local module = nn.View(4,-1):setNumInputDims(2)
+ local out = module:forward(minibatch)
+ mytester:assertTableEq(out:size(1), minibatch:size(1)*minibatch:size(2),
+ "Error in minibatch dimension with size -1")
+ mytester:assertTableEq(out:size(2), minibatch:size(3),
+ "Error in minibatch dimension with size -1")
+ mytester:assertTableEq(out:size(3), minibatch:size(4),
+ "Error in minibatch dimension with size -1")
+
-- Minibatch Generalization
local minibatch = torch.rand(5,2,6)
local module = nn.View(6)