Fix unused variable warning from assertion variable (#3512)

Inlines a variable into an assertion that is not used elsewhere to fix
build warnings.
pull/3519/head
Max191 2024-06-28 12:20:29 -04:00 committed by GitHub
parent f75cbb4df9
commit a1c4089e71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -69,14 +69,14 @@ Value torch_to_linalg::getDynamicZeroPaddedTensor(
int unpaddedDims, Value pad) {
assert(isa<RankedTensorType>(input.getType()) &&
"input must be RankedTensorType");
unsigned int inRank = cast<RankedTensorType>(input.getType()).getRank();
Location loc = op->getLoc();
SmallVector<Value> inputDims = getTensorSizes(b, loc, input);
Value c0 = b.create<arith::ConstantOp>(loc, b.getI64IntegerAttr(0));
SmallVector<Value> paddingIncludingUnchanged(unpaddedDims, c0);
paddingIncludingUnchanged.append(padding);
assert(unpaddedDims + padding.size() == inRank &&
assert(static_cast<int64_t>(unpaddedDims + padding.size()) ==
cast<RankedTensorType>(input.getType()).getRank() &&
"sum of unpaddedDims and padding.size() must equal to inputRank");
for (auto pad = paddingIncludingUnchanged.begin();
pad < paddingIncludingUnchanged.end(); pad++)