Skip to content

Commit

Permalink
Revert "Remove variable used for only assertion (#3837)"
Browse files Browse the repository at this point in the history
This reverts commit 6b58c89.
  • Loading branch information
rahuls-cerebras committed Jan 3, 2025
1 parent db020a6 commit 1ddee9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Dialect/Torch/IR/TorchOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4001,9 +4001,10 @@ OpFoldResult AtenSliceTensorOp::fold(FoldAdaptor adaptor) {
limit = limit < 0 ? limit + inType.getSizes()[dimInt] : limit;
limit = limit < 0 ? -1 : limit;
limit = std::min(limit, inType.getSizes()[dimInt]);
assert((stride > 0 && begin < limit) ||
(stride < 0 && begin > limit) &&
"aten.slice.Tensor iteration args are statically invalid.");
bool validIterArgs =
(stride > 0 && begin < limit) || (stride < 0 && begin > limit);
assert(validIterArgs &&
"aten.slice.Tensor iteration args are statically invalid.");

int64_t inputRank = inType.getSizes().size();
llvm::SmallVector<int64_t> inputStrides(inputRank, 1);
Expand Down

0 comments on commit 1ddee9f

Please sign in to comment.