mirror of https://github.com/llvm/torch-mlir
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
parent
16b3bd6e6c
commit
6b58c89914
|
@ -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<int64_t> inputStrides(inputRank, 1);
|
||||
|
|
Loading…
Reference in New Issue