Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

immutable accessors in graph signature #4433

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exir/passes/constant_prop_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ def erase_constant_node(
) -> None:
# Remove corresponding tensor from param/constants dict.
signature = exported_program.graph_signature
if name := signature.inputs_to_parameters.pop(node.name, None):
if name := signature.inputs_to_parameters.get(node.name, None):
exported_program.state_dict.pop(name, None)
elif name := signature.inputs_to_lifted_tensor_constants.pop(node.name, None):
elif name := signature.inputs_to_lifted_tensor_constants.get(node.name, None):
exported_program.constants.pop(name, None)
elif name := signature.inputs_to_buffers.pop(node.name, None):
elif name := signature.inputs_to_buffers.get(node.name, None):
exported_program.constants.pop(name, None)
exported_program.state_dict.pop(name, None)

Expand Down
2 changes: 1 addition & 1 deletion exir/program/_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def lift_constant_tensor_pass(ep):
return ep

graph_signature = ep.graph_signature
buffers = graph_signature.buffers
buffers = list(graph_signature.buffers)

fake_mode = list(ep.graph.nodes)[0].meta["val"].fake_mode
first_user_input = None
Expand Down
Loading