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:
authorLuke Hewitt <insperatum@gmail.com>2015-11-16 04:02:45 +0300
committerLuke Hewitt <insperatum@gmail.com>2015-11-16 04:02:45 +0300
commitb1ec1c1ddade74f06fe610ed589f9cfefdf22763 (patch)
tree3da119cb87cca23df1bdb2803b107bbf756518d7 /Identity.lua
parent402513b540305e4789d8d80feb0c262c82a449af (diff)
State variable pointers should never change.
see: https://github.com/torch/nn/blob/master/doc/module.md#state-variables
Diffstat (limited to 'Identity.lua')
-rw-r--r--Identity.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/Identity.lua b/Identity.lua
index 088cc34..18a3c9b 100644
--- a/Identity.lua
+++ b/Identity.lua
@@ -1,12 +1,12 @@
local Identity, _ = torch.class('nn.Identity', 'nn.Module')
function Identity:updateOutput(input)
- self.output = input
+ self.output:set(input:storage(), input:storageOffset(), input:size(), input:stride())
return self.output
end
function Identity:updateGradInput(input, gradOutput)
- self.gradInput = gradOutput
+ self.gradInput:set(gradOutput:storage(), gradOutput:storageOffset(), gradOutput:size(), gradOutput:stride())
return self.gradInput
end