signed/unsigned c++ compiler warning fixes (#2742)

pull/2748/head
James Newling 2024-01-11 09:46:46 -08:00 committed by GitHub
parent e1a86e480a
commit 47ffc90db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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();
@ -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();

View File

@ -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]);
}
@ -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]);
}

View File

@ -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) {