diff options
Diffstat (limited to 'CAddTable.lua')
-rw-r--r-- | CAddTable.lua | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/CAddTable.lua b/CAddTable.lua deleted file mode 100644 index 9603b4b..0000000 --- a/CAddTable.lua +++ /dev/null @@ -1,33 +0,0 @@ - -local CAddTable, parent = torch.class('nn.CAddTable', 'nn.Module') - -function CAddTable:__init() - parent.__init(self) - self.gradInput = {} -end - -function CAddTable:forward(input) - self.output:resizeAs(input[1]):copy(input[1]) - for i=2,#input do - self.output:add(input[i]) - end - return self.output -end - -function CAddTable:backward(input, gradOutput) - for i=1,#input do - self.gradInput[i] = self.gradInput[i] or torch.Tensor() - self.gradInput[i]:resizeAs(input[i]) - self.gradInput[i]:copy(gradOutput) - end - return self.gradInput -end - -function CAddTable:write(file) - parent.write(self, file) -end - -function CAddTable:read(file) - parent.read(self, file) - self.gradInput = {} -end |