@@ -260,8 +260,8 @@ class CPUROIPerspectiveTransformOpKernel : public framework::OpKernel<T> {
260
260
roi2image.Resize ({rois_num});
261
261
int * roi2image_data = roi2image.mutable_data <int >(ctx.GetPlace ());
262
262
auto lod = rois->lod ().back ();
263
- for (int i = 0 ; i < lod.size () - 1 ; ++i) {
264
- for (int j = lod[i]; j < lod[i + 1 ]; ++j) {
263
+ for (size_t i = 0 ; i < lod.size () - 1 ; ++i) {
264
+ for (size_t j = lod[i]; j < lod[i + 1 ]; ++j) {
265
265
roi2image_data[j] = i;
266
266
}
267
267
}
@@ -393,8 +393,8 @@ class CPUROIPerspectiveTransformGradOpKernel : public framework::OpKernel<T> {
393
393
roi2image.Resize ({rois_num});
394
394
int * roi2image_data = roi2image.mutable_data <int >(ctx.GetPlace ());
395
395
auto lod = rois->lod ().back ();
396
- for (int i = 0 ; i < lod.size () - 1 ; ++i) {
397
- for (int j = lod[i]; j < lod[i + 1 ]; ++j) {
396
+ for (size_t i = 0 ; i < lod.size () - 1 ; ++i) {
397
+ for (size_t j = lod[i]; j < lod[i + 1 ]; ++j) {
398
398
roi2image_data[j] = i;
399
399
}
400
400
}
@@ -404,7 +404,7 @@ class CPUROIPerspectiveTransformGradOpKernel : public framework::OpKernel<T> {
404
404
for (int in_h = 0 ; in_h < in_height; ++in_h) {
405
405
for (int in_w = 0 ; in_w < in_width; ++in_w) {
406
406
T gradient = 0.0 ;
407
- for (int roi_idx = lod[n]; roi_idx < lod[n + 1 ]; ++roi_idx) {
407
+ for (size_t roi_idx = lod[n]; roi_idx < lod[n + 1 ]; ++roi_idx) {
408
408
const T* rois = rois_data + roi_idx * 8 ;
409
409
T roi_x[4 ];
410
410
T roi_y[4 ];
0 commit comments