code: def ps_roi_max_pooling_2d(
      x, rois, roi_indices, outsize, spatial_scale, group_size
  ):
      """Position Sensitive Region of Interest (ROI) Max pooling function.
  
      This function computes position sensitive max of input spatial patch
      with the given region of interests. Each ROI is splitted into
      :math:`(group\_size, group\_size)` regions, and position sensitive values
      in each region is computed.
  
      Args:
          x (~chainer.Variable): Input variable. The shape is expected to be
              4 dimentional: (n: batch, c: channel, h, height, w: width).
          rois (array): Input roi. The shape is expected to
              be :math:`(R, 4)`, and each datum is set as below:
              (y_min, x_min, y_max, x_max). The dtype is :obj:`numpy.float32`.
          roi_indices (array): Input roi indices. The shape is expected to
              be :math:`(R, )`. The dtype is :obj:`numpy.int32`.
          outsize ((int, int, int) or (int, int) or int): Expected output size
              after pooled: (channel, height, width) or (height, width)
              or outsize. ``outsize=o`` and ``outsize=(o, o)`` are equivalent.
              Channel parameter is used to assert the input shape.
          spatial_scale (float): Scale of the roi is resized.
          group_size (int): Position sensitive group size.
  
      Returns:
          ~chainer.Variable: Output variable.
  
      See the original paper proposing PSROIPooling:
      `R-FCN <https://arxiv.org/abs/1605.06409>`_.
  
      """
      return PSROIMaxPooling2D(outsize, spatial_scale, group_size)(
          x, rois, roi_indices
      )
  
file_path: chainercv/chainercv/functions/ps_roi_max_pooling_2d.py
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_pooling_2d import _outsize
label_desc: Use image node_id 1 for calling a global function with example usage: ps_roi_max_pooling_2d(x, rois, roi_indices, outsize, spatial_scale, group_size) and returns: PSROIMaxPooling2D