[Mlir-commits] [mlir] [mlir:python] Prevent crash in DenseElementsAttr. (PR #163564)

Ingo Müller llvmlistbot at llvm.org
Mon Oct 20 06:20:48 PDT 2025


ingomueller-net wrote:

TBH, I have not tried but I am pretty confident that it doesn't matter how the attribute has been constructed. The [`bf_getbuffer`](https://docs.python.org/3/c-api/typeobj.html#c.PyBufferProcs.bf_getbuffer) protocol entails setting the [`format`](https://docs.python.org/3/library/struct.html#format-characters) indicating the element type. Unfortunately, there is such format for BF16, so we can't use that protocol for that datatype.

It could be that the `ml_dtypes` packages provides some other way, though; maybe that's a good starting point for expanding the type support here.

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


More information about the Mlir-commits mailing list