code: def forward(
      self,
      img_src: Tensor,
      text_src: Optional[Tensor] = None,
      text_mask: Optional[Tensor] = None,
      text_pos: Optional[Tensor] = None,
      output_hidden_states_only: bool = False,
      task_type: str = "detection",
      dataset_name: str = "detection_coco",
      task_idx: Optional[int] = None,
  ):
      img_mask = None
      img_pos = [None]
      if img_src is not None:
          if not isinstance(img_src, NestedTensor):
              img_src = NestedTensor.from_tensor_list(img_src)
          features, img_pos = self.backbone(img_src)
  
          img_src, img_mask = features[-1].decompose()
          img_src = self.input_proj(img_src)
  
      query_embed = self.query_embeds[task_type][dataset_name]
      hs, _ = self.transformer(
          img_src=img_src,
          img_mask=img_mask,
          img_pos=img_pos[-1],
          text_src=text_src,
          text_mask=text_mask,
          text_pos=text_pos,
          query_embed=query_embed.weight,
          task_type=task_type,
          dataset_name=dataset_name,
          task_idx=task_idx,
      )
  
      if hs is not None:
          assert hs.size(2) == self.num_queries[task_type][dataset_name]
  
      return {"hidden_states": hs}
  
imports: from typing import Optional
  import torch
  import torch.nn.functional
  from mmf.models.unit.backbone import build_unit_convnet_backbone
  from mmf.models.unit.matcher import HungarianMatcher
  from mmf.models.unit.misc import NestedTensor
  from mmf.models.unit.transformer import UniTTransformer
  from mmf.utils import box_ops
  from mmf.utils.distributed import get_world_size, is_dist_initialized
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling the UniTBaseModel obj's underlying member method code with example usage: obj.forward(img_src, text_src, text_mask, text_pos, output_hidden_states_only, task_type, dataset_name, task_idx) and returns: dict