class_docstr: Huber loss.
  
  Args:
      beta (float, optional): The threshold in the piecewise function.
          Defaults to 1.0.
      reduction (str, optional): The method to reduce the loss.
          Options are "none", "mean" and "sum". Defaults to "mean".
      loss_weight (float, optional): The weight of loss.
docstr: Forward function.
  
  Args:
      pred (Tensor): The prediction.
      target (Tensor): The learning target of the prediction.
      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: Calculated loss
docstr_tok: ["Forward","function",".","Args",":","pred","(","Tensor",")",":","The","prediction",".","target","(","Tensor",")",":","The","learning","target","of","the","prediction",".","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",":","Calculated","loss"]
code: def forward(
      self,
      pred: Tensor,
      target: Tensor,
      weight: Optional[Tensor] = None,
      avg_factor: Optional[int] = None,
      reduction_override: Optional[str] = None,
      **kwargs,
  ) -> Tensor:
      """Forward function.
  
      Args:
          pred (Tensor): The prediction.
          target (Tensor): The learning target of the prediction.
          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: Calculated loss
      """
      assert reduction_override in (None, "none", "mean", "sum")
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
      loss_bbox = self.loss_weight * huber_loss(
          pred,
          target,
          weight,
          beta=self.beta,
          reduction=reduction,
          avg_factor=avg_factor,
          **kwargs,
      )
      return loss_bbox
  
file_path: mmdetection/projects/EfficientDet/efficientdet/huber_loss.py
imports: from typing import Optional
  import torch
  import torch.nn
  from torch import Tensor
  from mmdet.models.losses.utils import weighted_loss
  from mmdet.registry import MODELS
label_desc: Use image node_id 2 for calling the HuberLoss obj's underlying member method code with example usage: obj.forward(pred, target, weight, avg_factor, reduction_override) and returns: loss_bbox