code: def giou_loss(pred, target, eps=1e-7):
      r"""`Generalized Intersection over Union: A Metric and A Loss for Bounding
      Box Regression <https://arxiv.org/abs/1902.09630>`_.
  
      Args:
          pred (torch.Tensor): Predicted bboxes of format (x1, y1, x2, y2),
              shape (n, 4).
          target (torch.Tensor): Corresponding gt bboxes, shape (n, 4).
          eps (float): Eps to avoid log(0).
  
      Return:
          Tensor: Loss tensor.
      """
      gious = bbox_overlaps(
          pred, target, mode="giou", is_aligned=True, eps=eps
      )
      loss = 1 - gious
      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 3 for calling a global function with example usage: giou_loss(pred, target, eps) and returns: loss