class_docstr: ROI max align over a set of 2d planes.
class_docstr_tok: ["ROI","max","align","over","a","set","of","2d","planes","."]
code: def __init__(self, outsize, spatial_scale, sampling_ratio=None):
      outh, outw = _pair(outsize)
      if not (isinstance(outh, numbers.Integral) and outh > 0):
          raise TypeError(
              "outsize[0] must be positive integer: {}, {}".format(
                  type(outh), outh
              )
          )
      if not (isinstance(outw, numbers.Integral) and outw > 0):
          raise TypeError(
              "outsize[1] must be positive integer: {}, {}".format(
                  type(outw), outw
              )
          )
      if isinstance(spatial_scale, numbers.Integral):
          spatial_scale = float(spatial_scale)
      if not (
          isinstance(spatial_scale, numbers.Real) and spatial_scale > 0
      ):
          raise TypeError(
              "spatial_scale must be a positive float number: {}, {}".format(
                  type(spatial_scale), spatial_scale
              )
          )
      sampling_ratio = _pair(sampling_ratio)
      if not all(
          (isinstance(s, numbers.Integral) and s >= 1) or s is None
          for s in sampling_ratio
      ):
          raise TypeError(
              "sampling_ratio must be integer >= 1 or a pair of it: {}".format(
                  sampling_ratio
              )
          )
  
      self.outh, self.outw = outh, outw
      self.spatial_scale = spatial_scale
      self.sampling_ratio = sampling_ratio
  
imports: import numbers
  import numpy
  import six
  import chainer
  from chainer.backends import cuda
  from chainer import function
  from chainer.functions.pooling.roi_average_align_2d import _GET_BILINEAR_INTERP_KERNEL
  from chainer.functions.pooling.roi_average_align_2d import _get_bilinear_interp_params
  from chainer.functions.pooling.roi_average_align_2d import _get_bounds
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 1 to create a new ROIMaxAlign2D object from inherited base classes: function with example: obj = ROIMaxAlign2D(outsize, spatial_scale, sampling_ratio)