[Mlir-commits] [mlir] ad39e5a - [MLIR][Python][Docs] Fix example of Python-defined dialects (#188174)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Mar 24 04:50:55 PDT 2026


Author: Twice
Date: 2026-03-24T19:50:49+08:00
New Revision: ad39e5a6b84819b75581ab8b1adafd1c8ffc9899

URL: https://github.com/llvm/llvm-project/commit/ad39e5a6b84819b75581ab8b1adafd1c8ffc9899
DIFF: https://github.com/llvm/llvm-project/commit/ad39e5a6b84819b75581ab8b1adafd1c8ffc9899.diff

LOG: [MLIR][Python][Docs] Fix example of Python-defined dialects (#188174)

Some breaking changes are introduced in #186574 for Python-defined
dialects. So we need to fix the example in the docs.

Added: 
    

Modified: 
    mlir/docs/Bindings/Python.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Bindings/Python.md b/mlir/docs/Bindings/Python.md
index f13dcdb99d63f..df186e43219c2 100644
--- a/mlir/docs/Bindings/Python.md
+++ b/mlir/docs/Bindings/Python.md
@@ -1307,12 +1307,12 @@ class MyInt(Dialect, name="myint"):
 
 class ConstantOp(MyInt.Operation, name="constant"):
     value: IntegerAttr
-    cst: Result[IntegerType[32]]
+    cst: Result[IntegerType[32]] = result(infer_type=True)
 
 class AddOp(MyInt.Operation, name="add"):
     lhs: Operand[IntegerType[32]]
     rhs: Operand[IntegerType[32]]
-    res: Result[IntegerType[32]]
+    res: Result[IntegerType[32]] = result(infer_type=True)
 
 # The code below requires an available MLIR context and location.
 


        


More information about the Mlir-commits mailing list