[Mlir-commits] [mlir] [mlir][linalg] Handle reassociationIndices correctly for 0D tensor (PR #121683)

Longsheng Mou llvmlistbot at llvm.org
Tue Jan 7 05:57:26 PST 2025


================
@@ -611,10 +611,13 @@ static Value expandRank(PatternRewriter &rewriter, Location loc, Value tensor,
   SmallVector<SmallVector<int64_t, 2>> reassociationIndices(
       shapedType.getRank());
   int64_t index = 0;
-  for (index = 0; index <= numExtraDims; index++)
-    reassociationIndices[0].push_back(index);
-  for (size_t position = 1; position < reassociationIndices.size(); position++)
-    reassociationIndices[position].push_back(index++);
+  if (shapedType.getRank() != 0) {
----------------
CoTinker wrote:

Done

https://github.com/llvm/llvm-project/pull/121683


More information about the Mlir-commits mailing list