class_docstr: Implementation of `Masked-attention Mask
  Transformer for Universal Image Segmentation
  <https://arxiv.org/pdf/2112.01527>`_.
  
  Args:
      backbone (dict): Configuration of backbone. Defaults to None.
      track_head (dict): Configuration of track head. Defaults to None.
      data_preprocessor (dict or ConfigDict, optional): The pre-process
         config of :class:`TrackDataPreprocessor`.  it usually includes,
          ``pad_size_divisor``, ``pad_value``, ``mean`` and ``std``.
          Defaults to None.
      init_cfg (dict or list[dict]): Configuration of initialization.
          Defaults to None.
class_docstr_tok: ["Implementation","of","`","Masked-attention","Mask","Transformer","for","Universal","Image","Segmentation","<","https",":","\/\/arxiv.org\/pdf\/2112.01527",">","`","_",".","Args",":","backbone","(","dict",")",":","Configuration","of","backbone",".","Defaults","to","None",".","track_head","(","dict",")",":","Configuration","of","track","head",".","Defaults","to","None",".","data_preprocessor","(","dict","or","ConfigDict",",","optional",")",":","The","pre-process","config","of",":","class",":","`","TrackDataPreprocessor","`",".","it","usually","includes",",","``","pad_size_divisor","``",",","``","pad_value","``",",","``","mean","``","and","``","std","``",".","Defaults","to","None",".","init_cfg","(","dict","or","list","[","dict","]",")",":","Configuration","of","initialization",".","Defaults","to","None","."]
docstr: Args:
      inputs (Tensor): Input images of shape (N, T, C, H, W).
          These should usually be mean centered and std scaled.
      data_samples (list[:obj:`TrackDataSample`]): The batch
          data samples. It usually includes information such
          as `gt_instance`.
  
  Returns:
      dict[str, Tensor]: a dictionary of loss components
docstr_tok: ["Args",":","inputs","(","Tensor",")",":","Input","images","of","shape","(","N",",","T",",","C",",","H",",","W",")",".","These","should","usually","be","mean","centered","and","std","scaled",".","data_samples","(","list","[",":","obj",":","`","TrackDataSample","`","]",")",":","The","batch","data","samples",".","It","usually","includes","information","such","as","`","gt_instance","`",".","Returns",":","dict","[","str",",","Tensor","]",":","a","dictionary","of","loss","components"]
code: def loss(
      self, inputs: Tensor, data_samples: TrackSampleList, **kwargs
  ) -> Union[dict, tuple]:
      """
      Args:
          inputs (Tensor): Input images of shape (N, T, C, H, W).
              These should usually be mean centered and std scaled.
          data_samples (list[:obj:`TrackDataSample`]): The batch
              data samples. It usually includes information such
              as `gt_instance`.
  
      Returns:
          dict[str, Tensor]: a dictionary of loss components
      """
      assert (
          inputs.dim() == 5
      ), "The img must be 5D Tensor (N, T, C, H, W)."
      # shape (N * T, C, H, W)
      img = inputs.flatten(0, 1)
  
      x = self.backbone(img)
      losses = self.track_head.loss(x, data_samples)
  
      return losses
  
file_path: mmdetection/mmdet/models/vis/mask2former_vis.py
imports: from typing import Optional, Union
  from torch import Tensor
  from mmdet.models.mot import BaseMOTModel
  from mmdet.registry import MODELS
  from mmdet.structures import TrackDataSample, TrackSampleList
  from mmdet.utils import OptConfigType, OptMultiConfig
label_desc: Use image node_id 3 for calling the Mask2FormerVideo obj's underlying member method code with example usage: obj.loss(inputs, data_samples) and returns: losses