diff options
author | Adam Paszke <adam.paszke@gmail.com> | 2016-03-15 03:09:24 +0300 |
---|---|---|
committer | Adam Paszke <adam.paszke@gmail.com> | 2016-03-15 03:10:38 +0300 |
commit | e59de3fd55381943961d6c3ff57c8060ee920d1f (patch) | |
tree | a1bb495d0b04b967f9a08ed7badada5b29b97e8d /View.lua | |
parent | 0f78da5b75bda357f780f1808e28e8333a8bcdb8 (diff) |
Fix backward-compatibility of nn.View
Diffstat (limited to 'View.lua')
-rw-r--r-- | View.lua | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -75,6 +75,7 @@ local function batchsize(input, size, numInputDims, numElements) end function View:updateOutput(input) + self.output = self.output or input.new() local bsz = batchsize(input, self.size, self.numInputDims, self.numElements) if bsz then self.output:view(input, bsz, table.unpack(self.size:totable())) @@ -85,6 +86,7 @@ function View:updateOutput(input) end function View:updateGradInput(input, gradOutput) + self.gradInput = self.gradInput or gradOutput.new() self.gradInput:view(gradOutput, input:size()) return self.gradInput end |