From 6f184775e89f19b586e51ef73ddc6affddf9a329 Mon Sep 17 00:00:00 2001 From: chengjuntao <18222160892@163.com> Date: Sun, 29 Sep 2019 11:22:04 +0800 Subject: [PATCH] Fix compling warning in deformable conv. (#20036) --- paddle/fluid/operators/deformable_conv_op.h | 8 ++++---- paddle/fluid/operators/deformable_conv_v1_op.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/operators/deformable_conv_op.h b/paddle/fluid/operators/deformable_conv_op.h index 33a97bf48b..4be98f3e6c 100644 --- a/paddle/fluid/operators/deformable_conv_op.h +++ b/paddle/fluid/operators/deformable_conv_op.h @@ -44,7 +44,7 @@ void ModulatedDeformableCol2imCPUKernel( const int dilation_w, const int channel_per_deformable_group, const int batch_size, const int deformable_group, const int height_col, const int width_col, T* grad_im) { - for (size_t thread = 0; thread < num_kernels; thread++) { + for (int thread = 0; thread < num_kernels; thread++) { const int j = (thread / width_col / height_col / batch_size) % kernel_w; const int i = (thread / width_col / height_col / batch_size / kernel_w) % kernel_h; @@ -128,7 +128,7 @@ void ModulatedDeformableCol2imCoordCPUKernel( const int channel_per_deformable_group, const int batch_size, const int offset_channels, const int deformable_group, const int height_col, const int width_col, T* grad_offset, T* grad_mask) { - for (size_t i = 0; i < num_kernels; i++) { + for (int i = 0; i < num_kernels; i++) { T val = 0, mval = 0; const int w = i % width_col; const int h = (i / width_col) % height_col; @@ -236,7 +236,7 @@ void ModulatedDeformableIm2colCPUKernel( const int channel_per_deformable_group, const int batch_size, const int num_channels, const int deformable_group, const int height_col, const int width_col, T* data_col) { - for (size_t i = 0; i < num_kernels; i++) { + for (int i = 0; i < num_kernels; i++) { const int w_col = i % width_col; const int h_col = (i / width_col) % height_col; const int b_col = (i / width_col) / height_col % batch_size; @@ -313,7 +313,7 @@ template void FilterGradAddupCPUKernel(const int nthreads, const int n, const int height, const int width, const T* dweight_3d, T* filter_grad) { - for (size_t i = 0; i < nthreads; i++) { + for (int i = 0; i < nthreads; i++) { filter_grad[i] = filter_grad[i] + dweight_3d[i]; } } diff --git a/paddle/fluid/operators/deformable_conv_v1_op.h b/paddle/fluid/operators/deformable_conv_v1_op.h index 89dc10cfa3..92b19e3904 100644 --- a/paddle/fluid/operators/deformable_conv_v1_op.h +++ b/paddle/fluid/operators/deformable_conv_v1_op.h @@ -45,7 +45,7 @@ void DeformableCol2imCPUKernel( const int channel_per_deformable_group, const int batch_size, const int deformable_group, const int height_col, const int width_col, T* grad_im) { - for (size_t thread = 0; thread < num_kernels; thread++) { + for (int thread = 0; thread < num_kernels; thread++) { const int j = (thread / width_col / height_col / batch_size) % kernel_w; const int i = (thread / width_col / height_col / batch_size / kernel_w) % kernel_h; @@ -124,7 +124,7 @@ void DeformableCol2imCoordCPUKernel( const int dilation_w, const int channel_per_deformable_group, const int batch_size, const int offset_channels, const int deformable_group, const int height_col, const int width_col, T* grad_offset) { - for (size_t i = 0; i < num_kernels; i++) { + for (int i = 0; i < num_kernels; i++) { T val = 0, mval = 0; const int w = i % width_col; const int h = (i / width_col) % height_col; @@ -218,7 +218,7 @@ void DeformableIm2colCPUKernel( const int channel_per_deformable_group, const int batch_size, const int num_channels, const int deformable_group, const int height_col, const int width_col, T* data_col) { - for (size_t i = 0; i < num_kernels; i++) { + for (int i = 0; i < num_kernels; i++) { const int w_col = i % width_col; const int h_col = (i / width_col) % height_col; const int b_col = (i / width_col) / height_col % batch_size; -- GitLab