Expanded MetaOps nodes PARTIALLY desappear from GraphView
What commit version of aidge do you use
-
aidge_core
: 0.6.1_dev
Context
When expanding MetaOperators, e.g PaddedConv
, the resulting Conv
and Pad
nodes are still listed in graph.get_nodes()
but are missing in graph.get_node(name)
Reproducible example code
import aidge_core as ai
import aidge_backend_cpu
conv = ai.PaddedConv2D(3, 16, [1, 1], "my_conv")
g = ai.GraphView()
g.add(conv)
for n in g.get_nodes():
print(f"node (from node list):\n\t▸ '{n}'\nnode (from Map(ame, node)):\n\t▸ '{g.get_node(n.name())}'")
print("expanding graph")
ai.expand_metaops(g)
for n in g.get_nodes():
print(f"node (from node list):\n\t▸ '{n}'\nnode (from Map(ame, node)):\n\t▸ '{g.get_node(n.name())}'", flush=True)
node (from node list):
▸ 'Node(name='my_conv_w', optype='Producer', children: [[1]])'
node (from Map(ame, node)):
▸ 'Node(name='my_conv_w', optype='Producer', children: [[1]])'
node (from node list):
▸ 'Node(name='my_conv_b', optype='Producer', children: [[1]])'
node (from Map(ame, node)):
▸ 'Node(name='my_conv_b', optype='Producer', children: [[1]])'
node (from node list):
▸ 'Node(name='my_conv', optype='PaddedConv2D', parents: [0, 1, 1], children: [[]])'
node (from Map(ame, node)):
▸ 'Node(name='my_conv', optype='PaddedConv2D', parents: [0, 1, 1], children: [[]])'
expanding graph
[NOTICE] - Replacing existing node name in graph node name registry: my_conv_conv
[NOTICE] - Replacing existing node name in graph node name registry: my_conv_pad
[WARNING] - No Node named my_conv_conv in the current GraphView .
node (from node list):
▸ 'Node(name='my_conv_conv', optype='Conv2D', parents: [1, 1, 1], children: [[]])'
node (from Map(ame, node)):
▸ 'None'
[WARNING] - No Node named my_conv_pad in the current GraphView .
node (from node list):
▸ 'Node(name='my_conv_pad', optype='Pad2D', parents: [0], children: [[1]])'
node (from Map(ame, node)):
▸ 'None'
node (from node list):
▸ 'Node(name='my_conv_w', optype='Producer', children: [[1]])'
node (from Map(ame, node)):
▸ 'Node(name='my_conv_w', optype='Producer', children: [[1]])'
node (from node list):
▸ 'Node(name='my_conv_b', optype='Producer', children: [[1]])'
node (from Map(ame, node)):
▸ 'Node(name='my_conv_b', optype='Producer', children: [[1]])'
Explanation
The new way expanedMetaOps
renames micrograph nodes since 6e222ad5 revealed that GraphView::updateNodeName
function was only changing the Node name if the name was new but removed the previous pair (name, node) whatever, resulting in the deletion of the node we wanted to rename if new and previous names are the same.
Other issue
Setting a node name to a name used by another node in the same GraphView will simply override the reference for the GraphView. This should instead throw an error
Edited by Maxence Naud