diff options
author | Soumith Chintala <soumith@gmail.com> | 2015-07-09 10:48:11 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2015-07-09 10:48:11 +0300 |
commit | e0196922091ee55bf5e939b2863304641aec5ddc (patch) | |
tree | 64cbb67b03ee08b46c32877da598f25665a5d869 /test.lua | |
parent | b7aa53d96fbb6c0f2eaa1976b28c5cf12edf1ced (diff) | |
parent | 350de823fcd43dcdc5948ef869d9ea135e2467a1 (diff) |
Merge pull request #285 from sergomezcol/master
Add support for negative indices in nn.SplitTable
Diffstat (limited to 'test.lua')
-rw-r--r-- | test.lua | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2929,6 +2929,13 @@ function nntest.SplitTable() module = nn.SplitTable(d, 2) mytester:asserteq(#module:forward(input), input:size(d+1), "dimension " .. d) end + + -- Negative indices + local module = nn.SplitTable(-3) + local input = torch.randn(3,4,5) + mytester:asserteq(#module:forward(input), 3, "negative index") + local input = torch.randn(2,3,4,5) + mytester:asserteq(#module:forward(input), 3, "negative index (minibatch)") end function nntest.SelectTable() |