class_docstr: IoULoss.
  
  Computing the IoU loss between a set of predicted bboxes and target bboxes.
  
  Args:
      eps (float): Eps to avoid log(0).
      reduction (str): Options are "none", "mean" and "sum".
      loss_weight (float): Weight of loss.
docstr: 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 (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. Options are "none", "mean" and "sum".
docstr_tok: ["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","(","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",".","Options","are","``","none","''",",","``","mean","''","and","``","sum","''","."]
code: def forward(
      self,
      pred,
      target,
      weight=None,
      avg_factor=None,
      reduction_override=None,
      **kwargs,
  ):
      """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 (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. Options are "none", "mean" and "sum".
      """
      assert reduction_override in (None, "none", "mean", "sum")
      reduction = (
          reduction_override if reduction_override else self.reduction
      )
      if (
          (weight is not None)
          and (not torch.any(weight > 0))
          and (reduction != "none")
      ):
          return (pred * weight).sum()  # 0
      if weight is not None and weight.dim() > 1:
          # TODO: remove this in the future
          # reduce the weight of shape (n, 4) to (n,) to match the
          # iou_loss of shape (n,)
          assert weight.shape == pred.shape
          weight = weight.mean(-1)
      loss = self.loss_weight * iou_loss(
          pred,
          target,
          weight,
          eps=self.eps,
          reduction=reduction,
          avg_factor=avg_factor,
          **kwargs,
      )
      return loss
  
imports: import math
  import torch
  import torch.nn
  from mmdet.core import bbox_overlaps
  from ..builder import LOSSES
  from .utils import weighted_loss
label_desc: Use image node_id 2 for calling the IoULoss obj's underlying member method code with example usage: obj.forward(pred, target, weight, avg_factor, reduction_override) and returns: loss, unknown