aboutsummaryrefslogtreecommitdiff
path: root/nerv/layer/graph.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/layer/graph.lua')
-rw-r--r--nerv/layer/graph.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/nerv/layer/graph.lua b/nerv/layer/graph.lua
index 36a9672..d72d849 100644
--- a/nerv/layer/graph.lua
+++ b/nerv/layer/graph.lua
@@ -64,6 +64,9 @@ function GraphLayer:graph_init(layer_repo, connections)
local id_to, port_to = parse_id(to)
local ref_from = self:discover(id_from, layer_repo)
local ref_to = self:discover(id_to, layer_repo)
+ if ref_from.outputs[port_from] ~= nil then
+ nerv.error('%s has already been attached', from)
+ end
if ref_to.inputs[port_to] ~= nil then
nerv.error('%s has already been attached', to)
end