[Mlir-commits] [mlir] [mlir] support scalable vectors in python bindings (PR #71050)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Nov 2 08:53:16 PDT 2023


================
@@ -300,14 +300,33 @@ def testVectorType():
 
         none = NoneType.get()
         try:
-            vector_invalid = VectorType.get(shape, none)
+            VectorType.get(shape, none)
         except MLIRError as e:
             # CHECK: Invalid type:
             # CHECK: error: unknown: vector elements must be int/index/float type but got 'none'
             print(e)
         else:
             print("Exception not produced")
 
+        scalable_1 = VectorType.get(shape, f32, scalable=[False, True])
+        scalable_2 = VectorType.get([2, 3, 4], f32, scalable=[True, False, True])
----------------
ftynse wrote:

This is consistent with how C++ constructors are implemented. I prefer consistency over niceness here, one can always add a wrapper.

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


More information about the Mlir-commits mailing list