Skip to content

Commit 47ffc90

Browse files
authored
signed/unsigned c++ compiler warning fixes (#2742)
1 parent e1a86e4 commit 47ffc90

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/torch-mlir/Conversion/TorchOnnxToTorch/Patterns.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct OpBinder {
6060
int64_t numOperands) {
6161
if (op->getNumOperands() != numOperands)
6262
return failure();
63-
for (int i = 0; i < numOperands; i++) {
63+
for (int64_t i = 0; i < numOperands; i++) {
6464
Value curr = op->getOperand(i);
6565
if (!toValidTensorType(curr.getType())) {
6666
return failure();
@@ -80,7 +80,7 @@ struct OpBinder {
8080
}
8181

8282
ParseResult tensorOperandsList( llvm::SmallVectorImpl<Value> &values) {
83-
for (int i = 0; i < op->getNumOperands(); i++) {
83+
for (uint32_t i = 0; i < op->getNumOperands(); i++) {
8484
values.push_back(op->getOperand(i));
8585
}
8686
return success();

lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
182182
return failure();
183183
}
184184
Value result = operands[0];
185-
for (int i = 1; i < operands.size(); i++) {
185+
for (uint64_t i = 1; i < operands.size(); i++) {
186186
result = rewriter.create<Torch::AtenMaximumOp>(
187187
binder.getLoc(), resultType, result, operands[i]);
188188
}
@@ -200,7 +200,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
200200
return failure();
201201
}
202202
Value result = operands[0];
203-
for (int i = 1; i < operands.size(); i++) {
203+
for (uint64_t i = 1; i < operands.size(); i++) {
204204
result = rewriter.create<Torch::AtenMinimumOp>(
205205
binder.getLoc(), resultType, result, operands[i]);
206206
}

lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
672672
int64_t adjustmentInt =
673673
cast<Torch::ValueTensorType>(data.getType()).getSizes().size();
674674
// convert axes (tensor) into torch int list while dealing with neg axis
675-
for (int i = 0; i < axes.size(); i++) {
675+
for (uint64_t i = 0; i < axes.size(); i++) {
676676
// Go through the axes list and get each dim in the list
677677
int64_t dim = axes[i];
678678
if (dim < 0) {

0 commit comments

Comments
 (0)