Skip to content
Closed
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
14 changes: 7 additions & 7 deletions exir/lowered_backend_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,17 @@ def _get_new_signature( # noqa: C901
new_state_dict = {}
new_constants = {}

input_tensor_node_to_sig = {
input_spec.arg.name: input_spec
for input_spec in old_signature.input_specs
if isinstance(input_spec.arg, TensorArgument)
}
placeholder_nodes = [
node.name for node in original_program.graph.nodes if node.op == "placeholder"
]
assert len(placeholder_nodes) == len(old_signature.input_specs)
input_node_to_sig = dict(zip(placeholder_nodes, old_signature.input_specs))

for node in gm.graph.nodes:
is_tagged = tag is None or node.meta.get("delegation_tag", None) == tag
if node.op == "placeholder":

if node.name not in input_tensor_node_to_sig:
if node.name not in input_node_to_sig:
assert tag is not None
input_specs.append(
InputSpec(
Expand All @@ -475,7 +475,7 @@ def _get_new_signature( # noqa: C901
)
continue

orig_input_spec = input_tensor_node_to_sig[node.name]
orig_input_spec = input_node_to_sig[node.name]

if not isinstance(orig_input_spec.arg, TensorArgument):
input_specs.append(orig_input_spec)
Expand Down