docstr: Extract per-box feature. This is similar to RoIAlign(sampling_ratio=1) except:
  1. It's implemented by point_sample
  2. It pools features across all levels and concat them, while typically
     RoIAlign select one level for every box. However in the config we only use
     one level (p2) so there is no difference.
  
  Returns:
      Tensor of shape (R, C, pooler_size, pooler_size) where R is the total number of boxes
docstr_tok: ["Extract","per-box","feature",".","This","is","similar","to","RoIAlign","(","sampling_ratio=1",")","except",":","1",".","It","'s","implemented","by","point_sample","2",".","It","pools","features","across","all","levels","and","concat","them",",","while","typically","RoIAlign","select","one","level","for","every","box",".","However","in","the","config","we","only","use","one","level","(","p2",")","so","there","is","no","difference",".","Returns",":","Tensor","of","shape","(","R",",","C",",","pooler_size",",","pooler_size",")","where","R","is","the","total","number","of","boxes"]
code: def _roi_pooler(self, features: List[Tensor], boxes: List[Boxes]):
      """
      Extract per-box feature. This is similar to RoIAlign(sampling_ratio=1) except:
      1. It's implemented by point_sample
      2. It pools features across all levels and concat them, while typically
         RoIAlign select one level for every box. However in the config we only use
         one level (p2) so there is no difference.
  
      Returns:
          Tensor of shape (R, C, pooler_size, pooler_size) where R is the total number of boxes
      """
      features_list = [features[k] for k in self.roi_pooler_in_features]
      features_scales = [
          self._feature_scales[k] for k in self.roi_pooler_in_features
      ]
  
      num_boxes = sum(x.tensor.size(0) for x in boxes)
      output_size = self.roi_pooler_size
      point_coords = generate_regular_grid_point_coords(
          num_boxes, output_size, boxes[0].device
      )
      # For regular grids of points, this function is equivalent to `len(features_list)' calls
      # of `ROIAlign` (with `SAMPLING_RATIO=1`), and concat the results.
      roi_features, _ = point_sample_fine_grained_features(
          features_list, features_scales, boxes, point_coords
      )
      return roi_features.view(
          num_boxes, roi_features.shape[1], output_size, output_size
      )
  
imports: import logging
  import math
  import numpy
  from typing import Dict, List, Tuple
  import fvcore.nn.weight_init
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.layers import Conv2d, ShapeSpec, cat, interpolate
  from detectron2.modeling import ROI_MASK_HEAD_REGISTRY
  from detectron2.modeling.roi_heads.mask_head import mask_rcnn_inference, mask_rcnn_loss
  from detectron2.structures import Boxes
  from .point_features import generate_regular_grid_point_coords, get_point_coords_wrt_image, get_uncertain_point_coords_on_grid, get_uncertain_point_coords_with_randomness, point_sample, point_sample_fine_grained_features, sample_point_labels
  from .point_head import build_point_head, roi_mask_point_loss
label_desc: Use image node_id 5 for calling the PointRendMaskHead obj's underlying member method code with example usage: obj._roi_pooler(features, boxes) and returns: roi_features