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:
authorIvo Danihelka <danihelka@google.com>2015-05-20 15:51:37 +0300
committerIvo Danihelka <danihelka@google.com>2015-05-20 15:51:37 +0300
commitf47dfc1c1c22bf87ab1e94f123a79b25ba76c8fe (patch)
tree961f04482d69fe84960ccbe94c5a101c7fd10d13
parent334eec0dc7a768371f4b19f4ea7de52a9e247f8a (diff)
Checked that gModule inputs and outputs are Nodes.
-rw-r--r--gmodule.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/gmodule.lua b/gmodule.lua
index 8dc100d..e6e5fab 100644
--- a/gmodule.lua
+++ b/gmodule.lua
@@ -50,8 +50,18 @@ function gModule:__init(inputs,outputs)
-- input point for the backward graph
local outnode = nngraph.Node({input={}})
for i,n in ipairs(outputs) do
+ if torch.typename(n) ~= 'nngraph.Node' then
+ error(string.format('what is this in the outputs[%s]? %s',
+ i, tostring(n)))
+ end
outnode:add(n,true)
end
+ for i,n in ipairs(inputs) do
+ if torch.typename(n) ~= 'nngraph.Node' then
+ error(string.format('what is this in the inputs[%s]? %s',
+ i, tostring(n)))
+ end
+ end
-- We add also a dummy input node.
-- The input node will be split to feed the passed input nodes.
local innode = nngraph.Node({input={}})