docstr: Forward function.
  
  Args:
      cls_score (torch.Tensor): The prediction.
      label (torch.Tensor): The learning label of the prediction.
      weight (torch.Tensor, optional): Sample-wise loss weight.
      avg_factor (int, optional): Average factor that is used to average
          the loss. Defaults to None.
      reduction (str, optional): The method used to reduce the loss.
          Options are "none", "mean" and "sum".
  Returns:
      torch.Tensor: The calculated loss
docstr_tok: ["Forward","function",".","Args",":","cls_score","(","torch.Tensor",")",":","The","prediction",".","label","(","torch.Tensor",")",":","The","learning","label","of","the","prediction",".","weight","(","torch.Tensor",",","optional",")",":","Sample-wise","loss","weight",".","avg_factor","(","int",",","optional",")",":","Average","factor","that","is","used","to","average","the","loss",".","Defaults","to","None",".","reduction","(","str",",","optional",")",":","The","method","used","to","reduce","the","loss",".","Options","are","``","none","''",",","``","mean","''","and","``","sum","''",".","Returns",":","torch.Tensor",":","The","calculated","loss"]
code: def forward(
      self,
      cls_score,
      label,
      weight=None,
      avg_factor=None,
      reduction_override=None,
      **kwargs,
  ):
      """Forward function.
  
      Args:
          cls_score (torch.Tensor): The prediction.
          label (torch.Tensor): The learning label of the prediction.
          weight (torch.Tensor, optional): Sample-wise loss weight.
          avg_factor (int, optional): Average factor that is used to average
              the loss. Defaults to None.
          reduction (str, optional): The method used to reduce the loss.
              Options are "none", "mean" and "sum".
      Returns:
          torch.Tensor: The calculated loss
      """
      assert reduction_override in (None, "none", "mean", "sum")
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
      if self.class_weight is not None:
          class_weight = cls_score.new_tensor(
              self.class_weight, device=cls_score.device
          )
      else:
          class_weight = None
      loss_cls = self.loss_weight * self.cls_criterion(
          cls_score,
          label,
          weight,
          class_weight=class_weight,
          reduction=reduction,
          avg_factor=avg_factor,
          **kwargs,
      )
      return loss_cls
  
file_path: insightface/detection/scrfd/mmdet/models/losses/cross_entropy_loss.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ..builder import LOSSES
  from .utils import weight_reduce_loss
label_desc: Use image node_id 2 for calling the CrossEntropyLoss obj's underlying member method code with example usage: obj.forward(cls_score, label, weight, avg_factor, reduction_override) and returns: loss_cls