diff --git a/lib/Dialect/Torch/IR/TorchOps.cpp b/lib/Dialect/Torch/IR/TorchOps.cpp index 97b724984..84fa405f9 100644 --- a/lib/Dialect/Torch/IR/TorchOps.cpp +++ b/lib/Dialect/Torch/IR/TorchOps.cpp @@ -4001,10 +4001,9 @@ 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]); - bool validIterArgs = - (stride > 0 && begin < limit) || (stride < 0 && begin > limit); - assert(validIterArgs && - "aten.slice.Tensor iteration args are statically invalid."); + assert((stride > 0 && begin < limit) || + (stride < 0 && begin > limit) && + "aten.slice.Tensor iteration args are statically invalid."); int64_t inputRank = inType.getSizes().size(); llvm::SmallVector inputStrides(inputRank, 1);