code: def backward_cpu(self, inputs, gy):
      _, bottom_rois, bottom_roi_indices = inputs
      height, width = self._bottom_data_shape[2:]
      bottom_diff = np.zeros(self._bottom_data_shape, np.float32)
  
      spatial_scale = self.spatial_scale
      pooled_height = self.out_h
      pooled_width = self.out_w
      group_size = self.group_size
      top_diff = gy[0]
  
      for i in six.moves.range(top_diff.size):
          n, ctop, ph, pw = np.unravel_index(i, top_diff.shape)
  
          roi_batch_ind = bottom_roi_indices[n]
          roi_start_h = bottom_rois[n, 0] * spatial_scale
          roi_start_w = bottom_rois[n, 1] * spatial_scale
          roi_end_h = bottom_rois[n, 2] * spatial_scale
          roi_end_w = bottom_rois[n, 3] * spatial_scale
  
          roi_height = max(roi_end_h - roi_start_h, 0.1)
          roi_width = max(roi_end_w - roi_start_w, 0.1)
          bin_size_h = roi_height / pooled_height
          bin_size_w = roi_width / pooled_width
  
          gh = int(np.floor(float(ph) * group_size / pooled_height))
          gw = int(np.floor(float(pw) * group_size / pooled_width))
          gh = min(max(gh, 0), group_size - 1)
          gw = min(max(gw, 0), group_size - 1)
          c = (ctop * group_size + gh) * group_size + gw
  
          top_diff_this_bin = top_diff[n, ctop, ph, pw]
          maxidx = self.argmax_data[n, ctop, ph, pw]
  
          if maxidx != -1:
              if self.sampling_ratio[0] is None:
                  roi_bin_grid_h = int(
                      np.ceil(roi_height / pooled_height)
                  )
              else:
                  roi_bin_grid_h = self.sampling_ratio[0]
              if self.sampling_ratio[1] is None:
                  roi_bin_grid_w = int(
                      np.ceil(roi_width / pooled_width)
                  )
              else:
                  roi_bin_grid_w = self.sampling_ratio[1]
  
              iy = int(maxidx / roi_bin_grid_w)
              ix = maxidx % roi_bin_grid_w
  
              y = (
                  roi_start_h
                  + ph * bin_size_h
                  + (iy + 0.5) * bin_size_h / roi_bin_grid_h
              )
              x = (
                  roi_start_w
                  + pw * bin_size_w
                  + (ix + 0.5) * bin_size_w / roi_bin_grid_w
              )
  
              y, y_low, y_high = _get_bounds(y, height)
              if y is None or y_low is None or y_high is None:
                  continue
              x, x_low, x_high = _get_bounds(x, width)
              if x is None or x_low is None or x_high is None:
                  continue
  
              # bilinear_interpolation_gradient {{
              w1, w2, w3, w4 = _get_bilinear_interp_params(
                  y, x, y_low, x_low, y_high, x_high
              )
  
              if w1 > 0 and y_low >= 0 and x_low >= 0:
                  g1 = top_diff_this_bin * w1
                  bottom_diff[roi_batch_ind, c, y_low, x_low] += g1
  
              if w2 > 0 and y_low >= 0 and x_high <= width - 1:
                  g2 = top_diff_this_bin * w2
                  bottom_diff[roi_batch_ind, c, y_low, x_high] += g2
  
              if w3 > 0 and y_high <= height - 1 and x_low >= 0:
                  g3 = top_diff_this_bin * w3
                  bottom_diff[roi_batch_ind, c, y_high, x_low] += g3
  
              if (
                  w4 > 0
                  and y_high <= height - 1
                  and x_high <= width - 1
              ):
                  g4 = top_diff_this_bin * w4
                  bottom_diff[roi_batch_ind, c, y_high, x_high] += g4
  
              # }}
  
      return bottom_diff, None, None
  
imports: from __future__ import division
  import numbers
  import numpy
  import six
  from chainer.backends import cuda
  from chainer import function
  from chainer.utils import type_check
  from chainercv.functions.ps_roi_average_align_2d import _GET_BILINEAR_INTERP_KERNEL
  from chainercv.functions.ps_roi_average_align_2d import _get_bilinear_interp_params
  from chainercv.functions.ps_roi_average_align_2d import _get_bounds
  from chainercv.functions.ps_roi_average_align_2d import _pair
  from chainercv.functions.ps_roi_average_pooling_2d import _outsize
label_desc: Use image node_id 5 for calling the PSROIMaxAlign2D obj's underlying member method code with example usage: obj.backward_cpu(inputs, gy) and returns: bottom_diff,  None,  None