[Mlir-commits] [mlir] [mlir] Drop outermost dims in slice rank reduction inference (PR #95020)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jun 11 13:36:01 PDT 2024


================
@@ -131,40 +131,40 @@ bool tensor::isSameTypeWithoutEncoding(Type tp1, Type tp2) {
 static llvm::SmallBitVector getDroppedDims(ArrayRef<int64_t> reducedShape,
                                            ArrayRef<OpFoldResult> mixedSizes) {
   llvm::SmallBitVector droppedDims(mixedSizes.size());
-  int64_t shapePos = 0;
+  int64_t shapePos = reducedShape.size() - 1;
 
-  for (const auto &size : enumerate(mixedSizes)) {
+  for (const auto &size : enumerate(llvm::reverse(mixedSizes))) {
----------------
MaheshRavishankar wrote:

I personally find `enumerate(reverse(...))` hard to keep track off in my head.

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


More information about the Mlir-commits mailing list