This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Add an InitTensorOp python builder.
ClosedPublic

Authored by stellaraccident on Mar 19 2021, 6:18 PM.

Details

Summary
  • This has the API I want but I am not thrilled with the implementation. There are various things that could be improved both about the way that Python builders are mapped and the way the Linalg ops are factored to increase code sharing between C++/Python.
  • Landing this as-is since it at least makes the InitTensorOp usable with the right API. Will refactor underneath in follow-ons.

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Mar 19 2021, 6:18 PM
mehdi_amini added inline comments.Mar 19 2021, 6:48 PM
mlir/lib/Bindings/Python/mlir/dialects/_linalg_ops_ext.py
10

Can you add a class doc? Even just to redirect to https://mlir.llvm.org/docs/Dialects/Linalg/#linalginit_tensor-mlirlinalginittensorop or at minimum mentioned that it maps to the linalg.init_tensor op.

nicolasvasilache accepted this revision.Mar 22 2021, 8:48 AM
This revision is now accepted and ready to land.Mar 22 2021, 8:48 AM
stellaraccident marked an inline comment as done.Mar 25 2021, 3:03 PM
stellaraccident added inline comments.
mlir/lib/Bindings/Python/mlir/dialects/_linalg_ops_ext.py
10

Done. (also realized that I forgot to document the extension mechanism. will do that in a followup)

stellaraccident marked an inline comment as done.

Comments and rebase.

This revision was landed with ongoing or failed builds.Mar 25 2021, 3:19 PM
This revision was automatically updated to reflect the committed changes.