Skip to content

Commit 7c3dfb2

Browse files
authored
[mlir][python] fix memref._is_constant_int_like (#89447)
1 parent 2a632d3 commit 7c3dfb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/python/mlir/dialects/memref.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
from ._memref_ops_gen import *
99
from ._ods_common import _dispatch_mixed_values, MixedValues
1010
from .arith import ConstantOp, _is_integer_like_type
11-
from ..ir import Value, MemRefType, StridedLayoutAttr, ShapedType
11+
from ..ir import Value, MemRefType, StridedLayoutAttr, ShapedType, Operation
1212

1313

1414
def _is_constant_int_like(i):
1515
return (
1616
isinstance(i, Value)
17+
and isinstance(i.owner, Operation)
1718
and isinstance(i.owner.opview, ConstantOp)
1819
and _is_integer_like_type(i.type)
1920
)

0 commit comments

Comments
 (0)