Skip to content

Commit adf1213

Browse files
committed
Arm backend: Cast int64 buffers to int32
Cast int64 buffers using get_attr in the same way as regular placeholders. Signed-off-by: Adrian Lundell <adrian.lundell@arm.com> Change-Id: Id3f9acda8f2d21fc582f743b1f59911f11e6c8d7
1 parent 31118d7 commit adf1213

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

backends/arm/_passes/insert_int32_casts_after_int64_placeholders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _insert_placeholder_i64_to_i32_casts(self, graph_module: torch.fx.GraphModul
8989
modified = False
9090
graph = graph_module.graph
9191
for node in graph.nodes:
92-
if node.op != "placeholder":
92+
if node.op not in ("placeholder", "get_attr"):
9393
continue
9494
node_val = node.meta["val"]
9595
if not self._is_tensor_of_dtype(node_val, torch.int64):

backends/arm/test/ops/test_clamp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ def test_clamp_vgf_quant(test_data):
257257
pipeline.run()
258258

259259

260-
aten_op_tensor = "torch.ops.aten.clamp.Tensor"
260+
aten_op_tensor = [
261+
"torch.ops.aten.clamp.Tensor",
262+
"torch.ops.dim_order_ops._to_dim_order_copy.default",
263+
]
261264
exir_op_tensor = "executorch_exir_dialects_edge__ops_aten_clamp_Tensor"
262265

263266
test_data_suite_tensor_FP = {

0 commit comments

Comments
 (0)