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:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2013-04-16 01:24:40 +0400
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2013-04-16 01:24:40 +0400
commitcf6587c60c6d393119cf4c485aff8c735a374492 (patch)
treee057b57f62413b103bd88cba93e54be882ae1bc6
parentd9cacd885147791446538c7786ccb41387c64d63 (diff)
CMul should resize the gradInput into the same shape as input.
-rw-r--r--CMul.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMul.lua b/CMul.lua
index 9b59944..317365b 100644
--- a/CMul.lua
+++ b/CMul.lua
@@ -7,7 +7,7 @@ function CMul:__init(inputSize)
self.gradWeight = torch.Tensor(inputSize)
-- state
- self.gradInput:resize(inputSize)
+ -- self.gradInput:resize(inputSize)
self.output:resize(inputSize)
self:reset()
@@ -25,6 +25,7 @@ end
function CMul:updateGradInput(input, gradOutput)
if self.gradInput then
+ self.gradInput:resizeAs(input)
self.gradInput:zero()
self.gradInput:addcmul(1, self.weight, gradOutput)
return self.gradInput