file:write('\n')
- for nnma, node in pairs(self.node) do
+ for nnmb, node in pairs(self.node) do
file:write(
' '
.. node.index
- .. ' [shape=box,label=\"' .. torch.type(nnma) .. '\"]'
+ .. ' [shape=box,label=\"' .. torch.type(nnmb) .. '\"]'
.. '\n'
)
- for _, nnmb in pairs(node.succ) do
+ for i, nnma in pairs(node.pred) do
+ local decoration = ''
+ if #node.pred > 1 then
+ decoration = ' [label=\"' .. i .. '\"]'
+ end
file:write(
' '
- .. node.index
+ .. self.node[nnma].index
.. ' -> '
.. self.node[nnmb].index
+ .. decoration
.. '\n'
)
end