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:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2015-05-20 17:03:12 +0300
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2015-05-20 17:03:12 +0300
commit7945e3a79a718ff4e8493344fda5ca565c783684 (patch)
tree961f04482d69fe84960ccbe94c5a101c7fd10d13
parent334eec0dc7a768371f4b19f4ea7de52a9e247f8a (diff)
parentf47dfc1c1c22bf87ab1e94f123a79b25ba76c8fe (diff)
Merge pull request #50 from fidlej/topic_argument_check
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={}})