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 <soumith@fb.com>2015-07-28 20:41:02 +0300
committersoumith <soumith@fb.com>2015-07-28 20:41:02 +0300
commit841227a5dd30d407c254941dd36c5ec17bd83daf (patch)
tree923052f6a7a9c515a5b0399312cfb5a98eadb7a7 /CSubTable.lua
parent194522f1ba96432ab19c176e23a0b9b981174770 (diff)
fixing table modules to return correct number of gradInputs
Diffstat (limited to 'CSubTable.lua')
-rw-r--r--CSubTable.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/CSubTable.lua b/CSubTable.lua
index b929e48..eb74920 100644
--- a/CSubTable.lua
+++ b/CSubTable.lua
@@ -17,5 +17,10 @@ function CSubTable:updateGradInput(input, gradOutput)
self.gradInput[2] = self.gradInput[2] or input[1].new()
self.gradInput[1]:resizeAs(input[1]):copy(gradOutput)
self.gradInput[2]:resizeAs(input[2]):copy(gradOutput):mul(-1)
+
+ for i=#input+1, #self.gradInput do
+ self.gradInput[i] = nil
+ end
+
return self.gradInput
end