[Mlir-commits] [mlir] [mlir][python] Add bindings for mlirDenseElementsAttrGet (PR #91389)

Maksim Levental llvmlistbot at llvm.org
Fri May 17 09:50:28 PDT 2024


makslevental wrote:

> Right, but doesn't this API still require us to construct the constituent elements individually? To pass the `elements` argument, we would still need several calls to, e.g. `FloatAttr::get` right?

Yea sorry you're right of course (and now I see that you were exactly alluding/implying that). Anyway, I don't have a certain/complete answer but it's not unlikely that the original value/goal was simply to make testing the C APIs (either through Python or just on their own) easier (i.e., creating `DenseElementsAttr` with only a few elements). To underscore what ftynse is implying: if your intent here is to create very large (i.e., realistic) `DenseElementsAttr` through this API you're gonna have a time. 

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


More information about the Mlir-commits mailing list