Skip to content

Commit

Permalink
Revert D60253955: immutable accessors in graph signature
Browse files Browse the repository at this point in the history
Differential Revision:
D60253955

Original commit changeset: eb6eb65bf17f

Original Phabricator Diff: D60253955

fbshipit-source-id: f203ef791da6f7efa40bf51a6e905eba65cb6b47
  • Loading branch information
atalman authored and facebook-github-bot committed Jul 26, 2024
1 parent 11407f0 commit 5d3ec13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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.get(node.name, None):
if name := signature.inputs_to_parameters.pop(node.name, None):
exported_program.state_dict.pop(name, None)
elif name := signature.inputs_to_lifted_tensor_constants.get(node.name, None):
elif name := signature.inputs_to_lifted_tensor_constants.pop(node.name, None):
exported_program.constants.pop(name, None)
elif name := signature.inputs_to_buffers.get(node.name, None):
elif name := signature.inputs_to_buffers.pop(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 = list(graph_signature.buffers)
buffers = graph_signature.buffers

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

0 comments on commit 5d3ec13

Please sign in to comment.