summaryrefslogtreecommitdiff
path: root/mlir/python
diff options
context:
space:
mode:
authorJacques Pienaar <jpienaar@google.com>2022-12-21 14:53:12 -0800
committerJacques Pienaar <jpienaar@google.com>2022-12-21 14:53:12 -0800
commit1f47fee2948ef48781084afe0426171d000d7997 (patch)
tree14a939349c8af640ff0fa146b069b72b3ea11ce9 /mlir/python
parent4d255f9e3374ecc5a85ac30ecbe65f3a737dfe35 (diff)
downloadllvm-1f47fee2948ef48781084afe0426171d000d7997.tar.gz
Revert "[mlir][py] Enable building ops with raw inputs"
Reverting to fix build bot. This reverts commit 3781b7905d8d808e5d4e97d597263f8ac48541b8.
Diffstat (limited to 'mlir/python')
-rw-r--r--mlir/python/mlir/ir.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/mlir/python/mlir/ir.py b/mlir/python/mlir/ir.py
index 19986917d69b..99e88ff74384 100644
--- a/mlir/python/mlir/ir.py
+++ b/mlir/python/mlir/ir.py
@@ -4,44 +4,3 @@
from ._mlir_libs._mlir.ir import *
from ._mlir_libs._mlir.ir import _GlobalDebug
-
-
-# Convenience decorator for registering user-friendly Attribute builders.
-def register_attribute_builder(kind):
- def decorator_builder(func):
- AttrBuilder.insert(kind, func)
- return func
- return decorator_builder
-
-
-@register_attribute_builder("BoolAttr")
-def _boolAttr(x: bool, context: Context):
- return BoolAttr.get(x, context=context)
-
-@register_attribute_builder("IndexAttr")
-def _indexAttr(x: int, context: Context):
- return IntegerAttr.get(IndexType.get(context=context), x)
-
-@register_attribute_builder("I32Attr")
-def _i32Attr(x: int, context: Context):
- return IntegerAttr.get(
- IntegerType.get_signless(32, context=context), x)
-
-@register_attribute_builder("I64Attr")
-def _i64Attr(x: int, context: Context):
- return IntegerAttr.get(
- IntegerType.get_signless(64, context=context), x)
-
-@register_attribute_builder("SymbolNameAttr")
-def _symbolNameAttr(x: str, context: Context):
- return StringAttr.get(x, context=context)
-
-try:
- import numpy as np
- @register_attribute_builder("IndexElementsAttr")
- def _indexElementsAttr(x: list[int], context: Context):
- return DenseElementsAttr.get(
- np.array(x, dtype=np.int64), type=IndexType.get(context=context),
- context=context)
-except ImportError:
- pass