class_docstr: Distribution Focal Loss (DFL) is a variant of `Generalized Focal Loss:
  Learning Qualified and Distributed Bounding Boxes for Dense Object
  Detection <https://arxiv.org/abs/2006.04388>`_.
  
  Args:
      reduction (str): Options are `'none'`, `'mean'` and `'sum'`.
      loss_weight (float): Loss weight of current loss.
docstr: Forward function.
  
  Args:
      pred (torch.Tensor): Predicted general distribution of bounding
          boxes (before softmax) with shape (N, n+1), n is the max value
          of the integral set `{0, ..., n}` in paper.
      target (torch.Tensor): Target distance label for bounding boxes
          with shape (N,).
      weight (torch.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.
docstr_tok: ["Forward","function",".","Args",":","pred","(","torch.Tensor",")",":","Predicted","general","distribution","of","bounding","boxes","(","before","softmax",")","with","shape","(","N",",","n+1",")",",","n","is","the","max","value","of","the","integral","set","`","{","0",",","...",",","n","}","`","in","paper",".","target","(","torch.Tensor",")",":","Target","distance","label","for","bounding","boxes","with","shape","(","N",",",")",".","weight","(","torch.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","."]
code: def forward(
      self,
      pred,
      target,
      weight=None,
      avg_factor=None,
      reduction_override=None,
  ):
      """Forward function.
  
      Args:
          pred (torch.Tensor): Predicted general distribution of bounding
              boxes (before softmax) with shape (N, n+1), n is the max value
              of the integral set `{0, ..., n}` in paper.
          target (torch.Tensor): Target distance label for bounding boxes
              with shape (N,).
          weight (torch.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.
      """
      assert reduction_override in (None, "none", "mean", "sum")
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
      loss_cls = self.loss_weight * distribution_focal_loss(
          pred,
          target,
          weight,
          reduction=reduction,
          avg_factor=avg_factor,
      )
      return loss_cls
  
file_path: insightface/detection/scrfd/mmdet/models/losses/gfocal_loss.py
imports: import torch.nn
  import torch.nn.functional
  from ..builder import LOSSES
  from .utils import weighted_loss
label_desc: Use image node_id 2 for calling the DistributionFocalLoss obj's underlying member method code with example usage: obj.forward(pred, target, weight, avg_factor, reduction_override) and returns: loss_cls