class_docstr: A mask point head use in PointRend.
  
  ``PointHead`` 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. Default: 3.
      in_channels (int): Number of input channels. Default: 256.
      fc_channels (int): Number of fc channels. Default: 256.
      num_classes (int): Number of classes for logits. Default: 80.
      class_agnostic (bool): Whether use class agnostic classification.
          If so, the output channels of logits will be 1. Default: False.
      coarse_pred_each_layer (bool): Whether concatenate coarse feature with
          the output of each fc layer. Default: True.
      conv_cfg (dict|None): Dictionary to construct and config conv layer.
          Default: dict(type='Conv1d'))
      norm_cfg (dict|None): Dictionary to construct and config norm layer.
          Default: None.
      loss_point (dict): Dictionary to construct and config loss layer of
          point head. Default: dict(type='CrossEntropyLoss', use_mask=True,
          loss_weight=1.0).
docstr: Forward function for training.
  Args:
      inputs (list[Tensor]): List of multi-level img features.
      prev_output (Tensor): The output of previous decode head.
      img_metas (list[dict]): List of image info dict where each dict
          has: 'img_shape', 'scale_factor', 'flip', and may also contain
          'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
          For details on the values of these keys see
          `mmseg/datasets/pipelines/formatting.py:Collect`.
      gt_semantic_seg (Tensor): Semantic segmentation masks
          used if the architecture supports semantic segmentation task.
      train_cfg (dict): The training config.
  
  Returns:
      dict[str, Tensor]: a dictionary of loss components
docstr_tok: ["Forward","function","for","training",".","Args",":","inputs","(","list","[","Tensor","]",")",":","List","of","multi-level","img","features",".","prev_output","(","Tensor",")",":","The","output","of","previous","decode","head",".","img_metas","(","list","[","dict","]",")",":","List","of","image","info","dict","where","each","dict","has",":","'img_shape","'",",","'scale_factor","'",",","'flip","'",",","and","may","also","contain","'filename","'",",","'ori_shape","'",",","'pad_shape","'",",","and","'img_norm_cfg","'",".","For","details","on","the","values","of","these","keys","see","`","mmseg\/datasets\/pipelines\/formatting.py",":","Collect","`",".","gt_semantic_seg","(","Tensor",")",":","Semantic","segmentation","masks","used","if","the","architecture","supports","semantic","segmentation","task",".","train_cfg","(","dict",")",":","The","training","config",".","Returns",":","dict","[","str",",","Tensor","]",":","a","dictionary","of","loss","components"]
code: def forward_train(
      self, inputs, prev_output, img_metas, gt_semantic_seg, train_cfg
  ):
      """Forward function for training.
      Args:
          inputs (list[Tensor]): List of multi-level img features.
          prev_output (Tensor): The output of previous decode head.
          img_metas (list[dict]): List of image info dict where each dict
              has: 'img_shape', 'scale_factor', 'flip', and may also contain
              'filename', 'ori_shape', 'pad_shape', and 'img_norm_cfg'.
              For details on the values of these keys see
              `mmseg/datasets/pipelines/formatting.py:Collect`.
          gt_semantic_seg (Tensor): Semantic segmentation masks
              used if the architecture supports semantic segmentation task.
          train_cfg (dict): The training config.
  
      Returns:
          dict[str, Tensor]: a dictionary of loss components
      """
      x = self._transform_inputs(inputs)
      with torch.no_grad():
          points = self.get_points_train(
              prev_output, calculate_uncertainty, cfg=train_cfg
          )
      fine_grained_point_feats = self._get_fine_grained_point_feats(
          x, points
      )
      coarse_point_feats = self._get_coarse_point_feats(
          prev_output, points
      )
      point_logits = self.forward(
          fine_grained_point_feats, coarse_point_feats
      )
      point_label = point_sample(
          gt_semantic_seg.float(),
          points,
          mode="nearest",
          align_corners=self.align_corners,
      )
      point_label = point_label.squeeze(1).long()
  
      losses = self.losses(point_logits, point_label)
  
      return losses
  
imports: import torch
  import torch.nn
  from annotator.uniformer.mmcv.cnn import ConvModule, normal_init
  from annotator.uniformer.mmcv.ops import point_sample
  from annotator.uniformer.mmseg.models.builder import HEADS
  from annotator.uniformer.mmseg.ops import resize
  from ..losses import accuracy
  from .cascade_decode_head import BaseCascadeDecodeHead
label_desc: Use image node_id 7 for calling the PointHead obj's underlying member method code with example usage: obj.forward_train(inputs, prev_output, img_metas, gt_semantic_seg, train_cfg) and returns: losses