Remove variable used for only assertion (#3837)

Removes a boolean variable that is used only for an assertion, and
inlines the condition into the assertion.

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
pull/3826/head
Max191 2024-10-30 10:51:06 -04:00 committed by GitHub
parent 16b3bd6e6c
commit 6b58c89914
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -4001,10 +4001,9 @@ OpFoldResult AtenSliceTensorOp::fold(FoldAdaptor adaptor) {
limit = limit < 0 ? limit + inType.getSizes()[dimInt] : limit; limit = limit < 0 ? limit + inType.getSizes()[dimInt] : limit;
limit = limit < 0 ? -1 : limit; limit = limit < 0 ? -1 : limit;
limit = std::min(limit, inType.getSizes()[dimInt]); limit = std::min(limit, inType.getSizes()[dimInt]);
bool validIterArgs = assert((stride > 0 && begin < limit) ||
(stride > 0 && begin < limit) || (stride < 0 && begin > limit); (stride < 0 && begin > limit) &&
assert(validIterArgs && "aten.slice.Tensor iteration args are statically invalid.");
"aten.slice.Tensor iteration args are statically invalid.");
int64_t inputRank = inType.getSizes().size(); int64_t inputRank = inType.getSizes().size();
llvm::SmallVector<int64_t> inputStrides(inputRank, 1); llvm::SmallVector<int64_t> inputStrides(inputRank, 1);