diff --git a/lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp b/lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp index 4df2e0f88..b9b60e774 100644 --- a/lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp +++ b/lib/Conversion/TorchOnnxToTorch/DefaultDomainAtoF.cpp @@ -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") && diff --git a/lib/Conversion/TorchToLinalg/TensorConstructors.cpp b/lib/Conversion/TorchToLinalg/TensorConstructors.cpp index 9429d1e8c..6afae47c1 100644 --- a/lib/Conversion/TorchToLinalg/TensorConstructors.cpp +++ b/lib/Conversion/TorchToLinalg/TensorConstructors.cpp @@ -98,11 +98,8 @@ namespace { Location loc = op->getLoc(); Value input = adaptor.getSelf(); - MLIRContext *context = rewriter.getContext(); auto inputType = llvm::cast(input.getType()); int64_t inputRank = inputType.getRank(); - auto outputType = llvm::cast( - getTypeConverter()->convertType(op->getResult(0).getType())); unsigned numDims = inputType.getRank(); assert(numDims >= 2 && "Not enough input dimensions"); @@ -171,16 +168,6 @@ namespace { } } - // Some generic helper functions to aid in constructing basic arithmetic. - auto createAdd = [&](Value x, Value y) { - return rewriter.create(loc, x, y); - }; - - auto createAdds = [&](std::initializer_list 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(loc, x, y); }; @@ -247,8 +234,6 @@ namespace { tensorsRes.push_back(leftPadTile); } if (hasTopPadding) { - Value topLeftValue = rewriter.create( - loc, input, ValueRange{zero, zero, zero, zero}); Value topHcenterSlice = rewriter.create( loc, input, extractOffsetsLT, extractShapeTB, allOneStrides); for (auto i = 0; i < padInts[2]; ++i) {