This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add `tensor.reshape`.
ClosedPublic

Authored by pifon2a on Apr 21 2021, 9:50 AM.

Details

Summary

This operation a counterpart of memref.reshape.

RFC Reshape Ops Restructuring

Diff Detail

Event Timeline

pifon2a created this revision.Apr 21 2021, 9:50 AM
pifon2a requested review of this revision.Apr 21 2021, 9:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:50 AM
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
239

is this needed ? I don't see it declaring the whatever view interface would require this?

243

I don't think the result type matches your doc ?

mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
453

Plz, verify the total number of elements when all is static.

pifon2a updated this revision to Diff 339567.Apr 22 2021, 4:47 AM

Address the comments.

nicolasvasilache accepted this revision.Apr 22 2021, 5:31 AM
nicolasvasilache added inline comments.
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
205

Your IR examples and assembly format want

: (tensor<?xf32>, tensor<2xi32>) -> tensor<?x?xf32>

Either is fine with me but plz be consistent.

238

Nit: I probably would have called this getResultTensorType, your call.

This revision is now accepted and ready to land.Apr 22 2021, 5:31 AM
pifon2a updated this revision to Diff 339590.Apr 22 2021, 5:51 AM
pifon2a marked 2 inline comments as done.

More comments.

This revision was landed with ongoing or failed builds.Apr 22 2021, 5:53 AM
This revision was automatically updated to reflect the committed changes.