diff --git a/src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp b/src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp index 33c6fa6a2..8fd689fc2 100644 --- a/src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp +++ b/src/enzyme_ad/jax/Passes/EnzymeHLOOpt.cpp @@ -202,7 +202,7 @@ struct AddPad final : OpRewritePattern { if (lhs.getEdgePaddingHigh()[idx] != 0) { starts[idx] = type.getShape()[idx] - lhs.getEdgePaddingHigh()[idx]; - limits[idx] = 0; + limits[idx] = type.getShape()[idx]; auto postSlice = rewriter.create(op.getLoc(), rhs, starts, limits, strides); vals.push_back(postSlice); }