[Mlir-commits] [mlir] [mlir][linalg][transform][python] Clean up _ext.py test. (PR #66469)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Sep 15 00:59:20 PDT 2023


================
@@ -18,33 +19,40 @@ def run(f):
     return f
 
 
+def create_sequence(func: Callable) -> Callable:
+    def decorated() -> None:
+        sequence = transform.SequenceOp(
+            transform.FailurePropagationMode.Propagate,
+            [],
+            transform.AnyOpType.get(),
+        )
+        with InsertionPoint(sequence.body):
+            func(sequence.bodyTarget)
+            transform.YieldOp()
+
+    decorated.__name__ = func.__name__
----------------
ftynse wrote:

`@functools.wraps(func)` on top of `decorated` looks better.

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


More information about the Mlir-commits mailing list