Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nngraph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Reynolds <mareynolds@google.com>2016-01-25 17:48:17 +0300
committerMalcolm Reynolds <mareynolds@google.com>2016-01-25 17:48:17 +0300
commita25e293345db8b23acb1411e381b392bcc819586 (patch)
treee64b429c446152105d8cb65c4c56dca542ecc7ac /gmodule.lua
parent6cd17c40f4cbc426d20894a58d81360724253333 (diff)
Don't bother filling a Tensor with zero right before we copy into it
Diffstat (limited to 'gmodule.lua')
-rw-r--r--gmodule.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/gmodule.lua b/gmodule.lua
index 99698c0..674bcf9 100644
--- a/gmodule.lua
+++ b/gmodule.lua
@@ -11,8 +11,8 @@ local function getTotalGradOutput(node)
node.data.gradOutputBuffer = node.data.gradOutputBuffer or nesting.cloneNested(gradOutput[1])
local gobuff = node.data.gradOutputBuffer
nesting.resizeNestedAs(gobuff, gradOutput[1])
- nesting.fillNested(gobuff, 0)
- for i=1,#gradOutput do
+ nesting.copyNested(gobuff, gradOutput[1])
+ for i=2,#gradOutput do
nesting.addNestedTo(gobuff, gradOutput[i])
end
gradOutput = gobuff