class_docstr: A mask point head use in PointRend.
  
  ``MaskPointHead`` use shared multi-layer perceptron (equivalent to
  nn.Conv1d) to predict the logit of input points. The fine-grained feature
  and coarse feature will be concatenate together for predication.
  
  Args:
      num_fcs (int): Number of fc layers in the head. Defaults to 3.
      in_channels (int): Number of input channels. Defaults to 256.
      fc_channels (int): Number of fc channels. Defaults to 256.
      num_classes (int): Number of classes for logits. Defaults to 80.
      class_agnostic (bool): Whether use class agnostic classification.
          If so, the output channels of logits will be 1. Defaults to False.
      coarse_pred_each_layer (bool): Whether concatenate coarse feature with
          the output of each fc layer. Defaults to True.
      conv_cfg (:obj:`ConfigDict` or dict): Dictionary to construct
          and config conv layer. Defaults to dict(type='Conv1d')).
      norm_cfg (:obj:`ConfigDict` or dict, optional): Dictionary to construct
          and config norm layer. Defaults to None.
      loss_point (:obj:`ConfigDict` or dict): Dictionary to construct and
          config loss layer of point head. Defaults to
          dict(type='CrossEntropyLoss', use_mask=True, loss_weight=1.0).
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict.
docstr: Get ``num_points`` most uncertain points during test.
  
  Args:
      mask_preds (Tensor): A tensor of shape (num_rois, num_classes,
          mask_height, mask_width) for class-specific or class-agnostic
          prediction.
      label_preds (Tensor): The predication class for each instance.
      cfg (:obj:`ConfigDict` or dict): Testing config of point head.
  
  Returns:
      tuple:
  
      - point_indices (Tensor): A tensor of shape (num_rois, num_points)
        that contains indices from [0, mask_height x mask_width) of the
        most uncertain points.
      - point_coords (Tensor): A tensor of shape (num_rois, num_points,
        2) that contains [0, 1] x [0, 1] normalized coordinates of the
        most uncertain points from the [mask_height, mask_width] grid.
docstr_tok: ["Get","``","num_points","``","most","uncertain","points","during","test",".","Args",":","mask_preds","(","Tensor",")",":","A","tensor","of","shape","(","num_rois",",","num_classes",",","mask_height",",","mask_width",")","for","class-specific","or","class-agnostic","prediction",".","label_preds","(","Tensor",")",":","The","predication","class","for","each","instance",".","cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Testing","config","of","point","head",".","Returns",":","tuple",":","-","point_indices","(","Tensor",")",":","A","tensor","of","shape","(","num_rois",",","num_points",")","that","contains","indices","from","[","0",",","mask_height","x","mask_width",")","of","the","most","uncertain","points",".","-","point_coords","(","Tensor",")",":","A","tensor","of","shape","(","num_rois",",","num_points",",","2",")","that","contains","[","0",",","1","]","x","[","0",",","1","]","normalized","coordinates","of","the","most","uncertain","points","from","the","[","mask_height",",","mask_width","]","grid","."]
code: def get_roi_rel_points_test(
      self, mask_preds: Tensor, label_preds: Tensor, cfg: ConfigType
  ) -> Tuple[Tensor, Tensor]:
      """Get ``num_points`` most uncertain points during test.
  
      Args:
          mask_preds (Tensor): A tensor of shape (num_rois, num_classes,
              mask_height, mask_width) for class-specific or class-agnostic
              prediction.
          label_preds (Tensor): The predication class for each instance.
          cfg (:obj:`ConfigDict` or dict): Testing config of point head.
  
      Returns:
          tuple:
  
          - point_indices (Tensor): A tensor of shape (num_rois, num_points)
            that contains indices from [0, mask_height x mask_width) of the
            most uncertain points.
          - point_coords (Tensor): A tensor of shape (num_rois, num_points,
            2) that contains [0, 1] x [0, 1] normalized coordinates of the
            most uncertain points from the [mask_height, mask_width] grid.
      """
      num_points = cfg.subdivision_num_points
      uncertainty_map = get_uncertainty(mask_preds, label_preds)
      num_rois, _, mask_height, mask_width = uncertainty_map.shape
  
      # During ONNX exporting, the type of each elements of 'shape' is
      # `Tensor(float)`, while it is `float` during PyTorch inference.
      if isinstance(mask_height, torch.Tensor):
          h_step = 1.0 / mask_height.float()
          w_step = 1.0 / mask_width.float()
      else:
          h_step = 1.0 / mask_height
          w_step = 1.0 / mask_width
      # cast to int to avoid dynamic K for TopK op in ONNX
      mask_size = int(mask_height * mask_width)
      uncertainty_map = uncertainty_map.view(num_rois, mask_size)
      num_points = min(mask_size, num_points)
      point_indices = uncertainty_map.topk(num_points, dim=1)[1]
      xs = w_step / 2.0 + (point_indices % mask_width).float() * w_step
      ys = h_step / 2.0 + (point_indices // mask_width).float() * h_step
      point_coords = torch.stack([xs, ys], dim=2)
      return point_indices, point_coords
  
imports: from typing import List, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.models.utils import get_uncertain_point_coords_with_randomness, get_uncertainty
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox2roi
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType
label_desc: Use image node_id 7 for calling the MaskPointHead obj's underlying member method code with example usage: obj.get_roi_rel_points_test(mask_preds, label_preds, cfg) and returns: point_indices,  point_coords