Skip to content

Commit 0dd1e57

Browse files
committed
add call_module op check
1 parent f341379 commit 0dd1e57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exir/backend/backend_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ def _insert_lowered_submodule(
208208
# handle getitem node in multi-method scenario
209209
call_submodule_inputs = []
210210
for inp_node in call_submodule_node.all_input_nodes:
211-
if inp_node.target == operator.getitem:
211+
if inp_node.target == operator.getitem and (
212+
inp_node.args[0].target == torch._higher_order_ops.executorch_call_delegate
213+
or inp_node.args[0].op == "call_module"
214+
):
212215
# it could be an executorch_call_delegate node or a submodule to be replaced
213216
subgraph = (
214217
# get owning_module of lowered_module node

0 commit comments

Comments
 (0)