         T q01 = (1 - dist_x) * dist_y;
         T q10 = dist_x * (1 - dist_y);
         T q11 = dist_x * dist_y;
-        int bottom_index_base = c * height * width;
 
         // compute gradient of input
         if (bottom_data_diff) {
           platform::CudaAtomicAdd(
-              bottom_data_diff + roi_batch_ind * channels * height * width +
-                  bottom_index_base + y0 * width + x0,
+              bottom_data_diff + bottom_index + y0 * width + x0,
               q00 * diff_val);
           platform::CudaAtomicAdd(
-              bottom_data_diff + roi_batch_ind * channels * height * width +
-                  bottom_index_base + y1 * width + x0,
+              bottom_data_diff + bottom_index + y1 * width + x0,
               q01 * diff_val);
           platform::CudaAtomicAdd(
-              bottom_data_diff + roi_batch_ind * channels * height * width +
-                  bottom_index_base + y0 * width + x1,
+              bottom_data_diff + bottom_index + y0 * width + x1,
               q10 * diff_val);
           platform::CudaAtomicAdd(
-              bottom_data_diff + roi_batch_ind * channels * height * width +
-                  bottom_index_base + y1 * width + x1,
+              bottom_data_diff + bottom_index + y1 * width + x1,
               q11 * diff_val);
         }
 

        }
        w = min(max(w, 0.), width - 1.);
        h = min(max(h, 0.), height - 1.);
        int c = (ctop * group_height + gh) * group_width + gw;
        int x0 = floor(w);
        int x1 = ceil(w);
        int y0 = floor(h);


using Tensor = framework::Tensor;
using LoDTensor = framework::LoDTensor;
using paddle::platform::PADDLE_CUDA_NUM_THREADS;

static inline int GET_BLOCKS(const int N) {
  return (N + PADDLE_CUDA_NUM_THREADS - 1) / PADDLE_CUDA_NUM_THREADS;
}

template <typename T>
