Skip to content

Commit 8b01546

Browse files
authored
fix compile warning (#8430)
1 parent 384a5dd commit 8b01546

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/fluid/operators/detection_map_op.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class DetectionMAPOpKernel : public framework::OpKernel<T> {
151151

152152
for (int n = 0; n < batch_size; ++n) {
153153
std::map<int, std::vector<Box>> boxes;
154-
for (int i = label_index[n]; i < label_index[n + 1]; ++i) {
154+
for (size_t i = label_index[n]; i < label_index[n + 1]; ++i) {
155155
Box box(labels(i, 2), labels(i, 3), labels(i, 4), labels(i, 5));
156156
int label = labels(i, 0);
157157
auto is_difficult = labels(i, 1);
@@ -167,7 +167,7 @@ class DetectionMAPOpKernel : public framework::OpKernel<T> {
167167
auto detect_index = detect_lod[0];
168168
for (int n = 0; n < batch_size; ++n) {
169169
std::map<int, std::vector<std::pair<T, Box>>> boxes;
170-
for (int i = detect_index[n]; i < detect_index[n + 1]; ++i) {
170+
for (size_t i = detect_index[n]; i < detect_index[n + 1]; ++i) {
171171
Box box(detect(i, 2), detect(i, 3), detect(i, 4), detect(i, 5));
172172
int label = detect(i, 0);
173173
auto score = detect(i, 1);
@@ -269,8 +269,8 @@ class DetectionMAPOpKernel : public framework::OpKernel<T> {
269269
std::map<int, std::vector<std::pair<T, int>>>& pos) {
270270
const T* pos_data = pos_tensor.data<T>();
271271
auto pos_data_lod = pos_tensor.lod();
272-
for (int i = 0; i < pos_data_lod.size(); ++i) {
273-
for (int j = pos_data_lod[0][i]; j < pos_data_lod[0][i + 1]; ++j) {
272+
for (size_t i = 0; i < pos_data_lod.size(); ++i) {
273+
for (size_t j = pos_data_lod[0][i]; j < pos_data_lod[0][i + 1]; ++j) {
274274
T score = pos_data[j * 2];
275275
int flag = 1;
276276
if (pos_data[j * 2 + 1] < kEPS) flag = 0;

0 commit comments

Comments
 (0)