[Mlir-commits] [mlir] [mlir][polynomial] python bindings (PR #93109)
Jacques Pienaar
llvmlistbot at llvm.org
Sat Jun 1 06:43:46 PDT 2024
================
@@ -0,0 +1,27 @@
+# RUN: %PYTHON %s | FileCheck %s
+
+from mlir.ir import *
+from mlir.dialects import polynomial
+
+
+def constructAndPrintInModule(f):
+ print("\nTEST:", f.__name__)
+ with Context(), Location.unknown():
+ module = Module.create()
+ with InsertionPoint(module.body):
+ f()
+ print(module)
+ return f
+
+
+# CHECK-LABEL: TEST: test_smoke
+ at constructAndPrintInModule
+def test_smoke():
+ value = Attribute.parse("#polynomial.float_polynomial<0.5 + 1.3e06 x**2>")
----------------
jpienaar wrote:
I was thinking this is the one where you'd rely on the builders rather than the generic parse (e.g., polynomial.FloatPolynomail) so that you'd be able to have a better error experience Python side/make errors less prone.
https://github.com/llvm/llvm-project/pull/93109
More information about the Mlir-commits
mailing list