Skip to content

Commit

Permalink
Fix unused variable warnings (#2775)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiro050 authored Jan 22, 2024
1 parent 73b3060 commit 5883ef0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ void mlir::torch::onnx_c::populateDefaultDomainAtoF(
if (binder.tensorResultType(resultType))
return failure();
auto dtype = resultType.getDtype();
Value scalarValue;

float floatValue;
if (binder.op->hasAttr("torch.onnx.value_float") &&
Expand Down
15 changes: 0 additions & 15 deletions lib/Conversion/TorchToLinalg/TensorConstructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ namespace {

Location loc = op->getLoc();
Value input = adaptor.getSelf();
MLIRContext *context = rewriter.getContext();
auto inputType = llvm::cast<RankedTensorType>(input.getType());
int64_t inputRank = inputType.getRank();
auto outputType = llvm::cast<RankedTensorType>(
getTypeConverter()->convertType(op->getResult(0).getType()));
unsigned numDims = inputType.getRank();
assert(numDims >= 2 && "Not enough input dimensions");

Expand Down Expand Up @@ -171,16 +168,6 @@ namespace {
}
}

// Some generic helper functions to aid in constructing basic arithmetic.
auto createAdd = [&](Value x, Value y) {
return rewriter.create<arith::AddIOp>(loc, x, y);
};

auto createAdds = [&](std::initializer_list<Value> values) {
assert(values.size() >= 2);
return std::accumulate(values.begin() + 1, values.end(), data(values)[0],
createAdd);
};
auto createSub = [&](Value x, Value y) {
return rewriter.create<arith::SubIOp>(loc, x, y);
};
Expand Down Expand Up @@ -247,8 +234,6 @@ namespace {
tensorsRes.push_back(leftPadTile);
}
if (hasTopPadding) {
Value topLeftValue = rewriter.create<tensor::ExtractOp>(
loc, input, ValueRange{zero, zero, zero, zero});
Value topHcenterSlice = rewriter.create<tensor::ExtractSliceOp>(
loc, input, extractOffsetsLT, extractShapeTB, allOneStrides);
for (auto i = 0; i < padInts[2]; ++i) {
Expand Down

0 comments on commit 5883ef0

Please sign in to comment.