[Mlir-commits] [mlir] [MLIR][Python] add f8E5M2 and tests for np_to_memref (PR #106028)

Maksim Levental llvmlistbot at llvm.org
Sun Aug 25 20:11:56 PDT 2024


================
@@ -65,6 +72,11 @@ def to_numpy(array):
     ), f"bfloat16 requires the ml_dtypes package, please run:\n\npip install ml_dtypes\n"
     if array.dtype == BF16:
         return array.view("bfloat16")
+    assert not (
+        array.dtype == F8E5M2 and ml_dtypes is None
+    ), f"float8_e5m2 requires the ml_dtypes package, please run:\n\npip install ml_dtypes\n"
----------------
makslevental wrote:

nit: you don't need the `f` here

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


More information about the Mlir-commits mailing list