end
end
+function DAG:setLabel(nnm, label)
+ self.node[nnm].label = label
+end
+
function DAG:setInput(i)
self.sorted = nil
self.inputModules = i
self:putInOrder()
for i, d in ipairs(self.sorted) do
- print('#' .. i .. ' -> ' .. torch.type(d))
+ local decoration = ''
+ if self.node[d].label then
+ decoration = ' [' .. self.node[d].label .. ']'
+ end
+ print('#' .. i .. ' -> ' .. torch.type(d) .. decoration)
end
end
file:write(
' '
.. node.index
- .. ' [shape=box,label=\"' .. torch.type(nnmb) .. '\"]'
+ .. ' [shape=box,label=\"' .. (self.node[nnmb].label or torch.type(nnmb)) .. '\"]'
.. '\n'
)