Skip to content

Commit 5917922

Browse files
committed
ints
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
1 parent 0080a85 commit 5917922

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

onnxscript/rewriter/_rewrite_rule.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def check(cls, context, x: ir.Value, perm: ir.Attr) -> bool:
392392
if perm.is_ref():
393393
return False
394394
if perm.type == ir.AttributeType.INTS:
395-
if perm.as_ints() == list(range(len(perm.as_ints()))):
395+
if list(perm.as_ints()) == list(range(len(perm.as_ints()))):
396396
return True
397397
return False
398398
"""
@@ -463,7 +463,7 @@ def check(cls, context, x: ir.Value, perm: ir.Attr) -> bool:
463463
if perm.is_ref():
464464
return False
465465
if perm.type == ir.AttributeType.INTS:
466-
if perm.as_ints() == list(range(len(perm.as_ints()))):
466+
if list(perm.as_ints()) == list(range(len(perm.as_ints()))):
467467
return True
468468
return False
469469

onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def check(
188188
trans_batch_property = "transBatchA" if self._pos == 1 else "transBatchB"
189189
trans_batch = fused_node.attributes.get_int(trans_batch_property, 0)
190190
transposed_node = _get_node(transposed, "Transpose")
191-
perm = transposed_node.attributes["perm"].as_ints()
191+
perm = list(transposed_node.attributes["perm"].as_ints())
192192
if not perm:
193193
return check_result.fail("Permutation values for Transpose are not correct.")
194194

0 commit comments

Comments
 (0)