class_docstr: FCIS Head for ResNet101 based implementation.
  
  This class is used as a head for FCIS.
  This outputs class-agnostice segmentation scores, class-agnostic
  localizations and classification based on feature maps in the given RoIs.
  
  Args:
      n_class (int): The number of classes possibly including the background.
      roi_size (int): Height and width of the feature maps after
          Position Sensitive RoI pooling.
      group_size (int): Group height and width for Position Sensitive
          ROI pooling.
      spatial_scale (float): Scale of the roi is resized.
      loc_normalize_mean (tuple of four floats): Mean values of
          localization estimates.
      loc_normalize_std (tupler of four floats): Standard deviation
          of localization estimates.
      iter2 (bool): if the value is set :obj:`True`, Position Sensitive
          ROI pooling is executed twice. In the second time, Position
          Sensitive ROI pooling uses improved ROIs by the localization
          parameters calculated in the first time.
      initialW (callable): Initializer for the layers.
class_docstr_tok: ["FCIS","Head","for","ResNet101","based","implementation",".","This","class","is","used","as","a","head","for","FCIS",".","This","outputs","class-agnostice","segmentation","scores",",","class-agnostic","localizations","and","classification","based","on","feature","maps","in","the","given","RoIs",".","Args",":","n_class","(","int",")",":","The","number","of","classes","possibly","including","the","background",".","roi_size","(","int",")",":","Height","and","width","of","the","feature","maps","after","Position","Sensitive","RoI","pooling",".","group_size","(","int",")",":","Group","height","and","width","for","Position","Sensitive","ROI","pooling",".","spatial_scale","(","float",")",":","Scale","of","the","roi","is","resized",".","loc_normalize_mean","(","tuple","of","four","floats",")",":","Mean","values","of","localization","estimates",".","loc_normalize_std","(","tupler","of","four","floats",")",":","Standard","deviation","of","localization","estimates",".","iter2","(","bool",")",":","if","the","value","is","set",":","obj",":","`","True","`",",","Position","Sensitive","ROI","pooling","is","executed","twice",".","In","the","second","time",",","Position","Sensitive","ROI","pooling","uses","improved","ROIs","by","the","localization","parameters","calculated","in","the","first","time",".","initialW","(","callable",")",":","Initializer","for","the","layers","."]
code: def _pool(
      self, h_cls_seg, h_ag_loc, rois, roi_indices, gt_roi_labels
  ):
      # PSROI Pooling
      # shape: (n_roi, n_class, 2, roi_size, roi_size)
      roi_cls_ag_seg_scores = ps_roi_average_pooling_2d(
          h_cls_seg,
          rois,
          roi_indices,
          (self.n_class * 2, self.roi_size, self.roi_size),
          self.spatial_scale,
          self.group_size,
      )
      roi_cls_ag_seg_scores = F.reshape(
          roi_cls_ag_seg_scores,
          (-1, self.n_class, 2, self.roi_size, self.roi_size),
      )
  
      # shape: (n_roi, 2*4, roi_size, roi_size)
      roi_ag_loc_scores = ps_roi_average_pooling_2d(
          h_ag_loc,
          rois,
          roi_indices,
          (2 * 4, self.roi_size, self.roi_size),
          self.spatial_scale,
          self.group_size,
      )
  
      # shape: (n_roi, n_class)
      roi_cls_scores = F.average(
          F.max(roi_cls_ag_seg_scores, axis=2), axis=(2, 3)
      )
  
      # Bbox Regression
      # shape: (n_roi, 2, 4)
      roi_ag_locs = F.average(roi_ag_loc_scores, axis=(2, 3))
      roi_ag_locs = F.reshape(roi_ag_locs, (-1, 2, 4))
  
      # Mask Regression
      # shape: (n_roi, n_class, 2, roi_size, roi_size)
      if gt_roi_labels is None:
          max_cls_indices = roi_cls_scores.array.argmax(axis=1)
      else:
          max_cls_indices = gt_roi_labels
  
      # shape: (n_roi, 2, roi_size, roi_size)
      roi_ag_seg_scores = roi_cls_ag_seg_scores[
          self.xp.arange(len(max_cls_indices)), max_cls_indices
      ]
  
      return roi_ag_seg_scores, roi_ag_locs, roi_cls_scores
  
imports: from __future__ import division
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
  from chainercv.experimental.links.model.fcis import FCIS
  from chainercv.functions import ps_roi_average_pooling_2d
  from chainercv.links import Conv2DBNActiv
  from chainercv.links.model.faster_rcnn.region_proposal_network import RegionProposalNetwork
  from chainercv.links.model.faster_rcnn.utils.loc2bbox import loc2bbox
  from chainercv.links.model.resnet.resblock import ResBlock
  from chainercv.links import ResNet101
  from chainercv import utils
label_desc: Use image node_id 3 for calling the FCISResNet101Head obj's underlying member method code with example usage: obj._pool(h_cls_seg, h_ag_loc, rois, roi_indices, gt_roi_labels) and returns: roi_ag_seg_scores,  roi_ag_locs,  roi_cls_scores