Fix compilation warning Wsign-compare (#1003)

pull/1018/head
Ramiro Leal-Cavazos 2022-07-06 11:06:10 -05:00 committed by GitHub
parent 33bfeda4c5
commit bbb648410e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -709,7 +709,7 @@ public:
Location loc = op.getLoc(); Location loc = op.getLoc();
Value self = op.self(); Value self = op.self();
MLIRContext *context = op.getContext(); MLIRContext *context = op.getContext();
auto rank = getTensorRank(self); int rank = getTensorRank(self);
if (rank < 0) if (rank < 0)
return rewriter.notifyMatchFailure(op, "Unimplemented: unranked tensor"); return rewriter.notifyMatchFailure(op, "Unimplemented: unranked tensor");
@ -718,7 +718,7 @@ public:
return rewriter.notifyMatchFailure( return rewriter.notifyMatchFailure(
op, "Unimplemented: repeats not list of Scalar"); op, "Unimplemented: repeats not list of Scalar");
if (rank > repeats.size()) { if (rank > (int)repeats.size()) {
return rewriter.notifyMatchFailure( return rewriter.notifyMatchFailure(
op, "repeats are not matched with self's rank"); op, "repeats are not matched with self's rank");
} }
@ -753,7 +753,7 @@ public:
auto selfType = self.getType().dyn_cast<BaseTensorType>(); auto selfType = self.getType().dyn_cast<BaseTensorType>();
auto selfShape = selfType.getSizes(); auto selfShape = selfType.getSizes();
for (size_t i = 0; i < rank; i++) { for (int i = 0; i < rank; i++) {
auto scale = repeats[i + leadingRank]; auto scale = repeats[i + leadingRank];
Value dimSize; Value dimSize;
if (selfShape[i] == ShapedType::kDynamicSize) { if (selfShape[i] == ShapedType::kDynamicSize) {