Skip to content

Commit 1d7f91e

Browse files
author
baiyfbupt
committed
fix roi_pool gpu_backward kernel
1 parent f79779f commit 1d7f91e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/fluid/operators/roi_pool_op.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ __global__ void GPUROIPoolBackward(
101101
int index = blockIdx.x * blockDim.x + threadIdx.x;
102102
int offset = blockDim.x * gridDim.x;
103103
for (int i = index; i < nthreads; i += offset) {
104-
int pw = index % pooled_width;
105-
int ph = (index / pooled_width) % pooled_height;
106-
int c = (index / pooled_width / pooled_height) % channels;
107-
int n = index / pooled_width / pooled_height / channels;
104+
int pw = i % pooled_width;
105+
int ph = (i / pooled_width) % pooled_height;
106+
int c = (i / pooled_width / pooled_height) % channels;
107+
int n = i / pooled_width / pooled_height / channels;
108108

109109
int roi_batch_ind = roi_batch_id_data[n];
110110
int input_offset = (roi_batch_ind * channels + c) * height * width;

0 commit comments

Comments
 (0)