This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Math] Improve docs (NFC)
ClosedPublic

Authored by chelini on May 30 2022, 6:20 AM.

Details

Summary

Remove boilerplate examples and add a text at the dialect level to describe
what kind of operands the operations accept (i.e., scalar, tensor or vector).
Left a shorter sentence describing the input operands for each operation as
this redundancy is convenient when browsing the documentation using the
website.

Diff Detail

Event Timeline

chelini created this revision.May 30 2022, 6:20 AM
chelini requested review of this revision.May 30 2022, 6:20 AM
ftynse accepted this revision.May 30 2022, 6:26 AM

I wonder if it would be better to just add a blob to the top of dialect documentation mentioning that all operations apply elementwise to vectors and tensors unless explicitly specified otherwise, rather than adding more boilerplate examples.

This revision is now accepted and ready to land.May 30 2022, 6:26 AM

I wonder if it would be better to just add a blob to the top of dialect documentation mentioning that all operations apply elementwise to vectors and tensors unless explicitly specified otherwise, rather than adding more boilerplate examples.

Right, perhaps it is better. I just did this to be consistent with other operations, but we can avoid boilerplate. I will do it.

chelini updated this revision to Diff 432927.May 30 2022, 8:13 AM

Remove boilerplate examples and add a text at the dialect level to describe
what kind of operands the operations accept (i.e., scalar, tensor or vector).
Left a shorter sentence describing the input operands for each operation as
this redundancy is convenient when browsing the documentation using the
website.

ftynse accepted this revision.May 30 2022, 8:43 AM
ftynse added inline comments.
mlir/include/mlir/Dialect/Math/IR/MathBase.td
18

One example here still makes sense :)

chelini updated this revision to Diff 432959.May 30 2022, 10:03 AM

Add example at dialect level.

chelini edited the summary of this revision. (Show Details)May 30 2022, 11:00 PM
chelini updated this revision to Diff 433020.May 30 2022, 11:08 PM
chelini marked an inline comment as done.

Add scalar example for 'rsqrt' for consistency.

This revision was landed with ongoing or failed builds.May 31 2022, 9:17 AM
This revision was automatically updated to reflect the committed changes.