Skip to content

Commit

Permalink
signed/unsigned c++ compiler warning fixes (llvm#2742)
Browse files Browse the repository at this point in the history
  • Loading branch information
newling authored Jan 11, 2024
1 parent e1a86e4 commit 47ffc90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/torch-mlir/Conversion/TorchOnnxToTorch/Patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct OpBinder {
int64_t numOperands) {
if (op->getNumOperands() != numOperands)
return failure();
for (int i = 0; i < numOperands; i++) {
for (int64_t i = 0; i < numOperands; i++) {
Value curr = op->getOperand(i);
if (!toValidTensorType(curr.getType())) {
return failure();
Expand All @@ -80,7 +80,7 @@ struct OpBinder {
}

ParseResult tensorOperandsList( llvm::SmallVectorImpl<Value> &values) {
for (int i = 0; i < op->getNumOperands(); i++) {
for (uint32_t i = 0; i < op->getNumOperands(); i++) {
values.push_back(op->getOperand(i));
}
return success();
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchOnnxToTorch/DefaultDomainGtoP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
return failure();
}
Value result = operands[0];
for (int i = 1; i < operands.size(); i++) {
for (uint64_t i = 1; i < operands.size(); i++) {
result = rewriter.create<Torch::AtenMaximumOp>(
binder.getLoc(), resultType, result, operands[i]);
}
Expand All @@ -200,7 +200,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
return failure();
}
Value result = operands[0];
for (int i = 1; i < operands.size(); i++) {
for (uint64_t i = 1; i < operands.size(); i++) {
result = rewriter.create<Torch::AtenMinimumOp>(
binder.getLoc(), resultType, result, operands[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/TorchOnnxToTorch/DefaultDomainQtoZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ void mlir::torch::onnx_c::populateDefaultDomainQtoZ(
int64_t adjustmentInt =
cast<Torch::ValueTensorType>(data.getType()).getSizes().size();
// convert axes (tensor) into torch int list while dealing with neg axis
for (int i = 0; i < axes.size(); i++) {
for (uint64_t i = 0; i < axes.size(); i++) {
// Go through the axes list and get each dim in the list
int64_t dim = axes[i];
if (dim < 0) {
Expand Down

0 comments on commit 47ffc90

Please sign in to comment.