Skip to content

[core] Attributes of node are not cloned

What commit version of aidge do you use

  • aidge_core: dev

Problem description

When cloning a node, the attributes of this node (mostly its name) are not cloned with it. Thus when renaming the cloned node afterward it also renames the old node.

Reproducible example code

You can attach code or use code block

import aidge_core

model = aidge_core.sequential([
    aidge_core.FC(in_channels=32 * 32 * 3, out_channels=512, name='old'),
    aidge_core.ReLU(name='1'),
])

node = model.get_node("old")
node2 = node.clone()
node2.set_name("new")
print(node.name())

will print "new" and not "old".