class_docstr: Loss function for knowledge distilling using KL divergence.
  
  Args:
      reduction (str): Options are `'none'`, `'mean'` and `'sum'`.
      loss_weight (float): Loss weight of current loss.
      T (int): Temperature for distillation.
docstr: Forward function.
  
  Args:
      pred (Tensor): Predicted logits with shape (N, n + 1).
      soft_label (Tensor): Target logits with shape (N, N + 1).
      weight (Tensor, optional): The weight of loss for each
          prediction. Defaults to None.
      avg_factor (int, optional): Average factor that is used to average
          the loss. Defaults to None.
      reduction_override (str, optional): The reduction method used to
          override the original reduction method of the loss.
          Defaults to None.
  
  Returns:
      Tensor: Loss tensor.
docstr_tok: ["Forward","function",".","Args",":","pred","(","Tensor",")",":","Predicted","logits","with","shape","(","N",",","n","+","1",")",".","soft_label","(","Tensor",")",":","Target","logits","with","shape","(","N",",","N","+","1",")",".","weight","(","Tensor",",","optional",")",":","The","weight","of","loss","for","each","prediction",".","Defaults","to","None",".","avg_factor","(","int",",","optional",")",":","Average","factor","that","is","used","to","average","the","loss",".","Defaults","to","None",".","reduction_override","(","str",",","optional",")",":","The","reduction","method","used","to","override","the","original","reduction","method","of","the","loss",".","Defaults","to","None",".","Returns",":","Tensor",":","Loss","tensor","."]
code: def forward(
      self,
      pred: Tensor,
      soft_label: Tensor,
      weight: Optional[Tensor] = None,
      avg_factor: Optional[int] = None,
      reduction_override: Optional[str] = None,
  ) -> Tensor:
      """Forward function.
  
      Args:
          pred (Tensor): Predicted logits with shape (N, n + 1).
          soft_label (Tensor): Target logits with shape (N, N + 1).
          weight (Tensor, optional): The weight of loss for each
              prediction. Defaults to None.
          avg_factor (int, optional): Average factor that is used to average
              the loss. Defaults to None.
          reduction_override (str, optional): The reduction method used to
              override the original reduction method of the loss.
              Defaults to None.
  
      Returns:
          Tensor: Loss tensor.
      """
      assert reduction_override in (None, "none", "mean", "sum")
  
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
  
      loss_kd = self.loss_weight * knowledge_distillation_kl_div_loss(
          pred,
          soft_label,
          weight,
          reduction=reduction,
          avg_factor=avg_factor,
          T=self.T,
      )
  
      return loss_kd
  
file_path: mmdetection/mmdet/models/losses/kd_loss.py
imports: from typing import Optional
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from mmdet.registry import MODELS
  from .utils import weighted_loss
label_desc: Use image node_id 2 for calling the KnowledgeDistillationKLDivLoss obj's underlying member method code with example usage: obj.forward(pred, soft_label, weight, avg_factor, reduction_override) and returns: loss_kd