diff options
author | Martin Simonovsky <simonovm@imagine.enpc.fr> | 2016-02-19 18:28:56 +0300 |
---|---|---|
committer | Martin Simonovsky <simonovm@imagine.enpc.fr> | 2016-02-19 18:28:56 +0300 |
commit | d64e5ddaf6f32b8ff199dcba50eac51bf4a0d4cc (patch) | |
tree | d74c1c51404a1ce88bd435949f422c941900bdc9 /Reshape.lua | |
parent | 870f5f987944ad34a1ab3d10b9bf0efb067a93ee (diff) |
Fixed wrong place of _gradOutput initialization
Diffstat (limited to 'Reshape.lua')
-rw-r--r-- | Reshape.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Reshape.lua b/Reshape.lua index 4f7c0a1..3501e54 100644 --- a/Reshape.lua +++ b/Reshape.lua @@ -31,7 +31,6 @@ end function Reshape:updateOutput(input) if not input:isContiguous() then self._input = self._input or input.new() - self._gradOutput = self._gradOutput or input.new() self._input:resizeAs(input) self._input:copy(input) input = self._input @@ -51,6 +50,7 @@ end function Reshape:updateGradInput(input, gradOutput) if not gradOutput:isContiguous() then + self._gradOutput = self._gradOutput or gradOutput.new() self._gradOutput:resizeAs(gradOutput) self._gradOutput:copy(gradOutput) gradOutput = self._gradOutput |