Skip to content

Commit

Permalink
Fix unused variable warning from assertion variable (#3512)
Browse files Browse the repository at this point in the history
Inlines a variable into an assertion that is not used elsewhere to fix
build warnings.
  • Loading branch information
Max191 authored Jun 28, 2024
1 parent f75cbb4 commit a1c4089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToLinalg/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit a1c4089

Please sign in to comment.