def METHOD_NAME(self,
            pred: Tensor,
            target: Tensor,
            weight: Optional[Tensor] = None,
            avg_factor: Optional[float] = None,
            reduction_override: Optional[str] = None) -> Tensor:
    """Forward function.
    Args:
        pred (torch.Tensor): The prediction.
        target (torch.Tensor): The learning target of the prediction.
        weight (torch.Tensor, optional): The weight of loss for each
            prediction. Defaults to None.
        avg_factor (float, 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)
    pred, weight, avg_factor = self.update_weight(pred, target, weight,
                                                  avg_factor)
    loss_bbox = self.loss_weight * l2_loss(
        pred, target, weight, reduction=reduction, avg_factor=avg_factor)
    return loss_bbox