diff --git a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp index 71024586b..59d3fe74f 100644 --- a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp +++ b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp @@ -59,7 +59,7 @@ static Type computeReductionType(PatternRewriter &rewriter, Operation *op, if (keepDim) sizes[dimInt] = 1; else - sizes.erase(sizes.begin() + dimInt - 1); + sizes.erase(sizes.begin() + dimInt); } else { unsigned reducedRank = keepDim ? inputRank : inputRank - 1; sizes.resize(reducedRank, kUnknownSize);