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:
authorSoumith Chintala <soumith@gmail.com>2015-07-21 21:56:15 +0300
committerSoumith Chintala <soumith@gmail.com>2015-07-21 21:56:15 +0300
commitd3328034c7fcb020f590249779750b6d25d75110 (patch)
treeec0411c4b66be08a06a023361fbf6ddfca222e51
parent8fa309f9f8633786f6340de2221c14032f4b7bb7 (diff)
parentf8dd135b19d370d8273423637d354d734801c077 (diff)
Merge pull request #62 from hughperkins/fix-gradOutputBuffer-type-change
"nesting.lua:36: bad argument #1 to 'resizeAs'"
-rw-r--r--gmodule.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/gmodule.lua b/gmodule.lua
index 3a3d9fe..4c37525 100644
--- a/gmodule.lua
+++ b/gmodule.lua
@@ -192,6 +192,13 @@ function gModule:type(type)
-- Loop through modules and convert data
self:apply(function(module) module:type(type) end)
+
+ for i,node in ipairs(self.backwardnodes) do
+ if node.data.gradOutputBuffer ~= nil then
+ node.data.gradOutputBuffer = node.data.gradOutputBuffer:type(type)
+ end
+ end
+
return self
end