@@ -104,7 +104,6 @@ bool in_quad(T x, T y, T roi_x[], T roi_y[]) {
104
104
* a31 = (dx3 * dy2 - dx2 * dy3) / (dx1 * dy2 - dx2 * dy1) / (w - 1)
105
105
* a32 = (dx1 * dy3 - dx3 * dy1) / (dx1 * dy2 - dx2 * dy1) / (h - 1)
106
106
* a33 = 1
107
- *
108
107
*/
109
108
template <typename T>
110
109
void get_transform_matrix (const int transformed_width,
@@ -260,8 +259,8 @@ class CPUROIPerspectiveTransformOpKernel : public framework::OpKernel<T> {
260
259
roi2image.Resize ({rois_num});
261
260
int * roi2image_data = roi2image.mutable_data <int >(ctx.GetPlace ());
262
261
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) {
262
+ for (size_t i = 0 ; i < lod.size () - 1 ; ++i) {
263
+ for (size_t j = lod[i]; j < lod[i + 1 ]; ++j) {
265
264
roi2image_data[j] = i;
266
265
}
267
266
}
@@ -393,8 +392,8 @@ class CPUROIPerspectiveTransformGradOpKernel : public framework::OpKernel<T> {
393
392
roi2image.Resize ({rois_num});
394
393
int * roi2image_data = roi2image.mutable_data <int >(ctx.GetPlace ());
395
394
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) {
395
+ for (size_t i = 0 ; i < lod.size () - 1 ; ++i) {
396
+ for (size_t j = lod[i]; j < lod[i + 1 ]; ++j) {
398
397
roi2image_data[j] = i;
399
398
}
400
399
}
@@ -404,7 +403,7 @@ class CPUROIPerspectiveTransformGradOpKernel : public framework::OpKernel<T> {
404
403
for (int in_h = 0 ; in_h < in_height; ++in_h) {
405
404
for (int in_w = 0 ; in_w < in_width; ++in_w) {
406
405
T gradient = 0.0 ;
407
- for (int roi_idx = lod[n]; roi_idx < lod[n + 1 ]; ++roi_idx) {
406
+ for (size_t roi_idx = lod[n]; roi_idx < lod[n + 1 ]; ++roi_idx) {
408
407
const T* rois = rois_data + roi_idx * 8 ;
409
408
T roi_x[4 ];
410
409
T roi_y[4 ];
0 commit comments