[Mlir-commits] [mlir] [MLIR][Linalg] Ternary Op & Linalg select (PR #91461)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed May 8 05:27:23 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 c9ab1d890586bd8a6a194e6a37968538b80f81bd...334e31622bea42341420bb59c6e0cbb2d71887af mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
``````````

</details>

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

``````````diff
--- lang/comprehension.py	2024-05-07 19:25:44.000000 +0000
+++ lang/comprehension.py	2024-05-08 12:26:51.747597 +0000
@@ -348,20 +348,23 @@
     """
 
     def __init__(self, fn_name: str):
         self.fn_name = fn_name
 
-    def __call__(self, arg0: TensorExpression, arg1: TensorExpression, arg2: TensorExpression) -> "TensorFn":
-        return TensorFn(FunctionKind.TERNARY, self.fn_name, None, None, [arg0, arg1, arg2])
+    def __call__(
+        self, arg0: TensorExpression, arg1: TensorExpression, arg2: TensorExpression
+    ) -> "TensorFn":
+        return TensorFn(
+            FunctionKind.TERNARY, self.fn_name, None, None, [arg0, arg1, arg2]
+        )
 
     def __repr__(self):
         return f"{self.fn_name}"
 
 
 class TernaryFn:
-    """Ternary function namespace.
-    """
+    """Ternary function namespace."""
 
     select = TernaryFnType("select")
 
 
 class TypeFnType:
@@ -714,11 +717,13 @@
         self.operand_def = OperandDef(
             OperandKind.TERNARY_FN_ATTR, default_fn=default.fn_name
         )
 
     def __call__(self, arg0: TensorExpression, arg1: TensorExpression) -> TensorFn:
-        return TensorFn(FunctionKind.TERNARY, None, self.operand_def, None, [arg0, arg1])
+        return TensorFn(
+            FunctionKind.TERNARY, None, self.operand_def, None, [arg0, arg1]
+        )
 
     def __getitem__(self, reduce_dims: Tuple[DimDef]) -> ReduceFnUse:
         return ReduceFnUse(None, self, *reduce_dims)
 
 

``````````

</details>


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


More information about the Mlir-commits mailing list