class_docstr: Implementation of `Per-Pixel Classification is
  NOT All You Need for Semantic Segmentation
  <https://arxiv.org/pdf/2107.06278>`_.
class_docstr_tok: ["Implementation","of","`","Per-Pixel","Classification","is","NOT","All","You","Need","for","Semantic","Segmentation","<","https",":","\/\/arxiv.org\/pdf\/2107.06278",">","`","_","."]
docstr: Args:
      batch_inputs (Tensor): Input images of shape (N, C, H, W).
          These should usually be mean centered and std scaled.
      batch_data_samples (list[:obj:`DetDataSample`]): The batch
          data samples. It usually includes information such
          as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`.
  
  Returns:
      dict[str, Tensor]: a dictionary of loss components
docstr_tok: ["Args",":","batch_inputs","(","Tensor",")",":","Input","images","of","shape","(","N",",","C",",","H",",","W",")",".","These","should","usually","be","mean","centered","and","std","scaled",".","batch_data_samples","(","list","[",":","obj",":","`","DetDataSample","`","]",")",":","The","batch","data","samples",".","It","usually","includes","information","such","as","`","gt_instance","`","or","`","gt_panoptic_seg","`","or","`","gt_sem_seg","`",".","Returns",":","dict","[","str",",","Tensor","]",":","a","dictionary","of","loss","components"]
code: def loss(
      self, batch_inputs: Tensor, batch_data_samples: SampleList
  ) -> Dict[str, Tensor]:
      """
      Args:
          batch_inputs (Tensor): Input images of shape (N, C, H, W).
              These should usually be mean centered and std scaled.
          batch_data_samples (list[:obj:`DetDataSample`]): The batch
              data samples. It usually includes information such
              as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`.
  
      Returns:
          dict[str, Tensor]: a dictionary of loss components
      """
      x = self.extract_feat(batch_inputs)
      losses = self.panoptic_head.loss(x, batch_data_samples)
      return losses
  
file_path: mmdetection/mmdet/models/detectors/maskformer.py
imports: from typing import Dict, List, Tuple
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .single_stage import SingleStageDetector
label_desc: Use image node_id 2 for calling the MaskFormer obj's underlying member method code with example usage: obj.loss(batch_inputs, batch_data_samples) and returns: losses