Skip to content

Commit be51b98

Browse files
gramalingamCopilot
andcommitted
fix: assign descriptive node names to lifted Constant nodes
Use f'initializer_{value.name}' as the node name for Constant nodes created by lift_initializers_to_constants. This follows the same likely-unique heuristic as the builder's own naming scheme (f'{op_type}_node_{count}') and makes lifted constants easily identifiable in the graph. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: G Ramalingam <grama@microsoft.com>
1 parent 95ac6df commit be51b98

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

onnxscript/_internal/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def lift_initializers_to_constants(graph: ir.Graph) -> None:
112112
attributes=[ir.Attr("value", ir.AttributeType.TENSOR, tensor)],
113113
outputs=[value],
114114
version=opset_version,
115+
name=f"initializer_{value.name}",
115116
)
116117
graph.initializers.pop(value.name)
117118
new_nodes.append(node)

0 commit comments

Comments
 (0)