[Mlir-commits] [mlir] [mlir][tensor] Enhance SimplifyUnPackToCollapseShape for unit dim cases. (PR #79262)
lorenzo chelini
llvmlistbot at llvm.org
Thu Jan 25 04:16:34 PST 2024
================
@@ -134,9 +135,36 @@ struct SimplifyUnPackToCollapseShape : public OpRewritePattern<UnPackOp> {
ArrayRef<int64_t> dimsPos = unpackOp.getInnerDimsPos();
if (dimsPos.size() != 1 || (dimsPos[0] + 1 != destType.getRank())) {
return rewriter.notifyMatchFailure(
- unpackOp, "expects unpacking at the innermost dimension");
+ unpackOp, "expects unpacking on the innermost dimension");
}
+ return success();
+ }
+
+ /// Returns success() if it unpacks a 1D or 2D source operand to a 1D
----------------
chelini wrote:
nit: the comment does not reflect implementation. I don't see why the source must be a 1d or a 2d tensor.
https://github.com/llvm/llvm-project/pull/79262
More information about the Mlir-commits
mailing list