class_docstr: Label Assignment Head from the paper: `Improving Object Detection by
  Label Assignment Distillation <https://arxiv.org/pdf/2108.10520.pdf>`_
class_docstr_tok: ["Label","Assignment","Head","from","the","paper",":","`","Improving","Object","Detection","by","Label","Assignment","Distillation","<","https",":","\/\/arxiv.org\/pdf\/2108.10520.pdf",">","`","_"]
docstr: Forward train with the available label assignment (student receives
  from teacher).
  
  Args:
      x (list[Tensor]): Features from FPN.
      label_assignment_results (tuple): As the outputs defined in the
          function `self.get_label_assignment`.
      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:
      losses: (dict[str, Tensor]): A dictionary of loss components.
docstr_tok: ["Forward","train","with","the","available","label","assignment","(","student","receives","from","teacher",")",".","Args",":","x","(","list","[","Tensor","]",")",":","Features","from","FPN",".","label_assignment_results","(","tuple",")",":","As","the","outputs","defined","in","the","function","`","self.get_label_assignment","`",".","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",":","losses",":","(","dict","[","str",",","Tensor","]",")",":","A","dictionary","of","loss","components","."]
code: def loss(
      self,
      x: List[Tensor],
      label_assignment_results: tuple,
      batch_data_samples: SampleList,
  ) -> dict:
      """Forward train with the available label assignment (student receives
      from teacher).
  
      Args:
          x (list[Tensor]): Features from FPN.
          label_assignment_results (tuple): As the outputs defined in the
              function `self.get_label_assignment`.
          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:
          losses: (dict[str, Tensor]): A dictionary of loss components.
      """
      outputs = unpack_gt_instances(batch_data_samples)
      (
          batch_gt_instances,
          batch_gt_instances_ignore,
          batch_img_metas,
      ) = outputs
  
      outs = self(x)
      loss_inputs = outs + (batch_gt_instances, batch_img_metas)
      losses = self.loss_by_feat(
          *loss_inputs,
          batch_gt_instances_ignore=batch_gt_instances_ignore,
          label_assignment_results=label_assignment_results,
      )
      return losses
  
file_path: mmdetection/mmdet/models/dense_heads/lad_head.py
imports: from typing import List, Optional
  import torch
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox_overlaps
  from mmdet.utils import InstanceList, OptInstanceList
  from ..utils import levels_to_images, multi_apply, unpack_gt_instances
  from .paa_head import PAAHead
label_desc: Use image node_id 2 for calling the LADHead obj's underlying member method code with example usage: obj.loss(x, label_assignment_results, batch_data_samples) and returns: losses