This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Tensor] Remove assert in PadOp builder
ClosedPublic

Authored by chelini on Oct 19 2022, 8:43 AM.

Details

Summary

The assert is misplaced as the result type is allowed to be null. A few
lines below the result type is inferred if it is passed a nullptr.
Besides, this behavior is described in the documentation of the builder.

Diff Detail

Event Timeline

chelini created this revision.Oct 19 2022, 8:43 AM
chelini requested review of this revision.Oct 19 2022, 8:43 AM

I suppose the intention was to check that the type is a ranked type when it is actually provided. This builder delegates to another, which does a cast that will assert, so there is no extra benefit in having this one.

ftynse accepted this revision.Oct 19 2022, 8:56 AM
This revision is now accepted and ready to land.Oct 19 2022, 8:56 AM
This revision was automatically updated to reflect the committed changes.