From 6b0a15f3f3f811f483ecd07e91d2f89a01bf4d6d Mon Sep 17 00:00:00 2001 From: Ronan Collobert Date: Wed, 18 Mar 2015 09:16:11 -0700 Subject: fix special View case with -1 arg and dimension set <> 1 added test case --- test.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test.lua') diff --git a/test.lua b/test.lua index 3661d03..f05e502 100644 --- a/test.lua +++ b/test.lua @@ -2738,6 +2738,13 @@ function nntest.View() minibatch:nElement(), "Error in minibatch nElement with size -1") + -- another setNumInputDims case + local minibatch = torch.rand(5,4,10) + local module = nn.View(-1):setNumInputDims(2) + mytester:assertTableEq(module:forward(minibatch):size(1), + minibatch:size(1), + "Error in minibatch dimension with size -1") + -- Minibatch Generalization local minibatch = torch.rand(5,2,6) local module = nn.View(6) -- cgit v1.2.3