Skip to content

[core] Renaming an node that had no name does not work

What commit version of aidge do you use

  • aidge_core: 0.2.1

Problem description

I'm using the nodes' names to modify the graph but when a node was not provided a name at creation, I cannot rename it with set_name (to identify it afterwards). I would expect that we could either rename it to a new one or just that it would be given a default name at some point.

Reproducible example code

import aidge_core

graph_view = aidge_core.sequential([
    aidge_core.FC(1, 50),
    aidge_core.ReLU("relu"),
])

for node in graph_view.get_nodes():
    if node.name() == "":
        node.set_name(f"unnamed_node")

Gives me:

Assertion failed: mNodeRegistry.find(oldName) != mNodeRegistry.end() in C:\Users\AL253370\Documents\Projets\DeepGreen\aidge\aidge\aidge_core\include\aidge/graph/GraphView.hpp:395
No node named  in graph , the graph may be corrupted !