Skip to content

Commit f08445d

Browse files
authored
Fix bug in ReplaceMulTensorWithMulAndFullOpsPass.
Differential Revision: D77962910 Pull Request resolved: #12287
1 parent 1ae4389 commit f08445d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backends/cadence/aot/replace_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ def call(self, graph_module: torch.fx.GraphModule) -> PassResult:
23292329
# Extract an argument to a separate full op.
23302330
with graph_module.graph.inserting_before(mul_node):
23312331
full_tensor = graph_module.graph.call_function(
2332-
exir_ops.edge.aten.full.default, args=([1], full_arg)
2332+
torch.ops.aten.full.default, args=([1], full_arg)
23332333
)
23342334
new_mul_node = graph_module.graph.call_function(
23352335
torch.ops.aten.mul.Tensor, args=(x_arg, full_tensor)
@@ -2449,4 +2449,5 @@ class CadenceReplaceOpsInGraph:
24492449
ReplaceAtenApproxGeluWithApproxGeluPass,
24502450
ReplaceSplitWithSlicePass,
24512451
ReplacePowWithMulPass,
2452+
ReplaceMulTensorWithMulAndFullOpsPass,
24522453
]

backends/cadence/aot/tests/test_replace_ops_passes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ def test_extract_mul_argument_to_full(
19331933
graph_after_passes,
19341934
expected_op_counts={
19351935
torch.ops.aten.mul.Tensor: 1,
1936-
exir_ops.edge.aten.full.default: 1,
1936+
torch.ops.aten.full.default: 1,
19371937
},
19381938
)
19391939
)

0 commit comments

Comments
 (0)