summaryrefslogtreecommitdiff
path: root/mlir/python
diff options
context:
space:
mode:
authorAmy Wang <kai.ting.wang@huawei.com>2024-09-11 07:37:35 -0400
committerGitHub <noreply@github.com>2024-09-11 07:37:35 -0400
commit334873fe2df27a4fa613e8744f29e502d3358397 (patch)
tree8ad624ae529c7496a6a22f11e4a30a37039a8c58 /mlir/python
parente50131aa068f74daa70d4135c92020aadae3af33 (diff)
[MLIR][Python] Python binding support for IntegerSet attribute (#107640)
Support IntegerSet attribute python binding.
Diffstat (limited to 'mlir/python')
-rw-r--r--mlir/python/mlir/_mlir_libs/_mlir/ir.pyi16
-rw-r--r--mlir/python/mlir/ir.py5
2 files changed, 21 insertions, 0 deletions
diff --git a/mlir/python/mlir/_mlir_libs/_mlir/ir.pyi b/mlir/python/mlir/_mlir_libs/_mlir/ir.pyi
index 7b4fac7275bf..a3d3a9261869 100644
--- a/mlir/python/mlir/_mlir_libs/_mlir/ir.pyi
+++ b/mlir/python/mlir/_mlir_libs/_mlir/ir.pyi
@@ -138,6 +138,7 @@ __all__ = [
"InsertionPoint",
"IntegerAttr",
"IntegerSet",
+ "IntegerSetAttr",
"IntegerSetConstraint",
"IntegerSetConstraintList",
"IntegerType",
@@ -1905,6 +1906,21 @@ class IntegerSet:
@property
def n_symbols(self) -> int: ...
+class IntegerSetAttr(Attribute):
+ static_typeid: ClassVar[TypeID]
+ @staticmethod
+ def get(integer_set) -> IntegerSetAttr:
+ """
+ Gets an attribute wrapping an IntegerSet.
+ """
+ @staticmethod
+ def isinstance(other: Attribute) -> bool: ...
+ def __init__(self, cast_from_attr: Attribute) -> None: ...
+ @property
+ def type(self) -> Type: ...
+ @property
+ def typeid(self) -> TypeID: ...
+
class IntegerSetConstraint:
def __init__(self, *args, **kwargs) -> None: ...
@property
diff --git a/mlir/python/mlir/ir.py b/mlir/python/mlir/ir.py
index a9ac765fe1c1..9a6ce462047a 100644
--- a/mlir/python/mlir/ir.py
+++ b/mlir/python/mlir/ir.py
@@ -22,6 +22,11 @@ def _affineMapAttr(x, context):
return AffineMapAttr.get(x)
+@register_attribute_builder("IntegerSetAttr")
+def _integerSetAttr(x, context):
+ return IntegerSetAttr.get(x)
+
+
@register_attribute_builder("BoolAttr")
def _boolAttr(x, context):
return BoolAttr.get(x, context=context)