diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-07-30 22:28:56 +0400 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-07-30 22:28:56 +0400 |
commit | 03bd1d7df6ddc482e728a7d0a5fcfb843b991275 (patch) | |
tree | fdf3dd0d847db485d04459f1a77d8884bc843a9b | |
parent | 0d9a4a50c9253b032a41ad114c41aa82d370d102 (diff) |
Update extra/nn/Sum.lua
make sure that self.output is a tensor
-rw-r--r-- | Sum.lua | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -7,6 +7,9 @@ function Sum:__init(dimension) end function Sum:updateOutput(input) + if type(self.output) == 'number' then + self.output = input.new() + end input.torch.sum(self.output, input, self.dimension) self.output = self.output:select(self.dimension, 1) return self.output |