[Mlir-commits] [mlir] [mlir][python] add type wrappers (PR #71218)
Maksim Levental
llvmlistbot at llvm.org
Tue Nov 14 07:14:29 PST 2023
makslevental wrote:
> My overall thinking here is that we want to delimit optional "sugar" from fundamental APIs, and make sure unsugared APIs are still usable. Any thoughts on how to make this clear?
Well, as the comment[^1] that was the impetus for this PR suggests, the fundamental APIs prioritize "authenticity" over ergonomics and that's fine. It's useful that they more closely reflect the C APIs underneath because then the bindings partially serve as a gentle on-ramp to the rest of the codebase.
Regarding making things more clearly delineated - we could move these to a `sugar.` namespace or some other more professional sounding word (`helpers.` ?).
> I'm not sure how much of this should be treated as sugar, maybe we can just have a "types" object in dialect that contains such constructor functions?
Generating a whole bunch of this from the ODS is feasible, it's just tedious, corner-case chasing, implementation.
> Overall, this also needs more documentation. Both docstrings and overall design in https://mlir.llvm.org/docs/Bindings/Python/. (btw, magic value downcasting should also be described there).
Good point. Will add in this PR.
[^1]: though I did notice you ultimately did add `scalable_dims`.
https://github.com/llvm/llvm-project/pull/71218
More information about the Mlir-commits
mailing list