[Mlir-commits] [mlir] 6ac24ce - [mlir] fix python types

Alex Zinenko llvmlistbot at llvm.org
Fri Jan 20 08:03:34 PST 2023


Author: Alex Zinenko
Date: 2023-01-20T16:03:27Z
New Revision: 6ac24ce6569d38049d03e8fa434242c3b336c888

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

LOG: [mlir] fix python types

Added: 
    

Modified: 
    mlir/python/mlir/dialects/_structured_transform_ops_ext.py

Removed: 
    


################################################################################
diff  --git a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
index f045e5c13c1ed..97705e2ad6523 100644
--- a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
+++ b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
@@ -254,7 +254,7 @@ def __init__(self,
 
   @overload
   def __init__(self,
-               target: Union[Operation, Value],
+               target: Union[Operation, Value, OpView],
                *,
                sizes: Optional[Union[Sequence[Union[int, IntegerAttr, Operation,
                                                     Value]], ArrayAttr]] = None,
@@ -265,7 +265,7 @@ def __init__(self,
 
   def __init__(self,
                loop_types_or_target: Union[Type, List[Type], Operation, Value],
-               target_or_none: Optional[Union[Operation, Value]] = None,
+               target_or_none: Optional[Union[Operation, Value, OpView]] = None,
                *,
                sizes: Optional[Union[Sequence[Union[int, IntegerAttr, Operation,
                                                     Value]], ArrayAttr]] = None,
@@ -291,7 +291,7 @@ def __init__(self,
     num_loops = sum(
         v if v == 0 else 1 for v in self.__extract_values(sizes_attr))
 
-    if isinstance(loop_types_or_target, (Operation, Value)):
+    if isinstance(loop_types_or_target, (Operation, Value, OpView)):
       loop_types = [transform.AnyOpType.get()] * num_loops
       target = loop_types_or_target
       assert target_or_none is None, "Cannot construct TileOp with two targets."


        


More information about the Mlir-commits mailing list