提交 6f184775 编写于 作者: C chengjuntao 提交者: qingqing01

Fix compling warning in deformable conv. (#20036)

上级 da892caf
...@@ -44,7 +44,7 @@ void ModulatedDeformableCol2imCPUKernel( ...@@ -44,7 +44,7 @@ void ModulatedDeformableCol2imCPUKernel(
const int dilation_w, const int channel_per_deformable_group, const int dilation_w, const int channel_per_deformable_group,
const int batch_size, const int deformable_group, const int height_col, const int batch_size, const int deformable_group, const int height_col,
const int width_col, T* grad_im) { 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 j = (thread / width_col / height_col / batch_size) % kernel_w;
const int i = const int i =
(thread / width_col / height_col / batch_size / kernel_w) % kernel_h; (thread / width_col / height_col / batch_size / kernel_w) % kernel_h;
...@@ -128,7 +128,7 @@ void ModulatedDeformableCol2imCoordCPUKernel( ...@@ -128,7 +128,7 @@ void ModulatedDeformableCol2imCoordCPUKernel(
const int channel_per_deformable_group, const int batch_size, const int channel_per_deformable_group, const int batch_size,
const int offset_channels, const int deformable_group, const int height_col, const int offset_channels, const int deformable_group, const int height_col,
const int width_col, T* grad_offset, T* grad_mask) { 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; T val = 0, mval = 0;
const int w = i % width_col; const int w = i % width_col;
const int h = (i / width_col) % height_col; const int h = (i / width_col) % height_col;
...@@ -236,7 +236,7 @@ void ModulatedDeformableIm2colCPUKernel( ...@@ -236,7 +236,7 @@ void ModulatedDeformableIm2colCPUKernel(
const int channel_per_deformable_group, const int batch_size, const int channel_per_deformable_group, const int batch_size,
const int num_channels, const int deformable_group, const int height_col, const int num_channels, const int deformable_group, const int height_col,
const int width_col, T* data_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 w_col = i % width_col;
const int h_col = (i / width_col) % height_col; const int h_col = (i / width_col) % height_col;
const int b_col = (i / width_col) / height_col % batch_size; const int b_col = (i / width_col) / height_col % batch_size;
...@@ -313,7 +313,7 @@ template <typename T> ...@@ -313,7 +313,7 @@ template <typename T>
void FilterGradAddupCPUKernel(const int nthreads, const int n, const int height, void FilterGradAddupCPUKernel(const int nthreads, const int n, const int height,
const int width, const T* dweight_3d, const int width, const T* dweight_3d,
T* filter_grad) { 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]; filter_grad[i] = filter_grad[i] + dweight_3d[i];
} }
} }
......
...@@ -45,7 +45,7 @@ void DeformableCol2imCPUKernel( ...@@ -45,7 +45,7 @@ void DeformableCol2imCPUKernel(
const int channel_per_deformable_group, const int batch_size, const int channel_per_deformable_group, const int batch_size,
const int deformable_group, const int height_col, const int width_col, const int deformable_group, const int height_col, const int width_col,
T* grad_im) { 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 j = (thread / width_col / height_col / batch_size) % kernel_w;
const int i = const int i =
(thread / width_col / height_col / batch_size / kernel_w) % kernel_h; (thread / width_col / height_col / batch_size / kernel_w) % kernel_h;
...@@ -124,7 +124,7 @@ void DeformableCol2imCoordCPUKernel( ...@@ -124,7 +124,7 @@ void DeformableCol2imCoordCPUKernel(
const int dilation_w, const int channel_per_deformable_group, const int dilation_w, const int channel_per_deformable_group,
const int batch_size, const int offset_channels, const int 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) { 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; T val = 0, mval = 0;
const int w = i % width_col; const int w = i % width_col;
const int h = (i / width_col) % height_col; const int h = (i / width_col) % height_col;
...@@ -218,7 +218,7 @@ void DeformableIm2colCPUKernel( ...@@ -218,7 +218,7 @@ void DeformableIm2colCPUKernel(
const int channel_per_deformable_group, const int batch_size, const int channel_per_deformable_group, const int batch_size,
const int num_channels, const int deformable_group, const int height_col, const int num_channels, const int deformable_group, const int height_col,
const int width_col, T* data_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 w_col = i % width_col;
const int h_col = (i / width_col) % height_col; const int h_col = (i / width_col) % height_col;
const int b_col = (i / width_col) / height_col % batch_size; const int b_col = (i / width_col) / height_col % batch_size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册