[Mlir-commits] [mlir] [MLIR][Python] Python binding support for AffineIfOp (PR #107336)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 4 17:38:13 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r df50751d24da4f5fdf8f46119c09a7e941f7174b...22eafd60cb8bdaddcc7e22c1632c52381a2cdd6c mlir/python/mlir/dialects/affine.py mlir/python/mlir/ir.py mlir/test/python/dialects/affine.py mlir/test/python/ir/attributes.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- test/python/dialects/affine.py	2024-09-05 00:30:50.000000 +0000
+++ test/python/dialects/affine.py	2024-09-05 00:37:43.516483 +0000
@@ -291,11 +291,11 @@
         with InsertionPoint(if_op.then_block):
             one = arith.ConstantOp(i32, 1)
             add = arith.AddIOp(one, one)
             affine.AffineYieldOp([])
         return
-    
+
 
 # CHECK-LABEL: TEST: testAffineIfWithElse
 @constructAndPrintInModule
 def testAffineIfWithElse():
     index = IndexType.get()
@@ -320,11 +320,13 @@
     # CHECK:            return
     # CHECK:        }
 
     @func.FuncOp.from_py_func(index)
     def simple_affine_if_else(cond_operands):
-        if_op = affine.AffineIfOp(cond, [i32, i32], cond_operands=[cond_operands], hasElse=True)
+        if_op = affine.AffineIfOp(
+            cond, [i32, i32], cond_operands=[cond_operands], hasElse=True
+        )
         with InsertionPoint(if_op.then_block):
             x_true = arith.ConstantOp(i32, 0)
             y_true = arith.ConstantOp(i32, 1)
             affine.AffineYieldOp([x_true, y_true])
         with InsertionPoint(if_op.else_block):

``````````

</details>


https://github.com/llvm/llvm-project/pull/107336


More information about the Mlir-commits mailing list