class_docstr: Implements the GIoU loss function.
  
  GIoU loss was first introduced in the
  [Generalized Intersection over Union:
  A Metric and A Loss for Bounding Box Regression]
  (https://giou.stanford.edu/GIoU.pdf).
  GIoU is an enhancement for models which use IoU in object detection.
  
  Usage:
  
  >>> gl = tfa.losses.GIoULoss()
  >>> boxes1 = tf.constant([[4.0, 3.0, 7.0, 5.0], [5.0, 6.0, 10.0, 7.0]])
  >>> boxes2 = tf.constant([[3.0, 4.0, 6.0, 8.0], [14.0, 14.0, 15.0, 15.0]])
  >>> loss = gl(boxes1, boxes2)
  >>> loss
  <tf.Tensor: shape=(), dtype=float32, numpy=1.5041667>
  
  Usage with `tf.keras` API:
  
  >>> model = tf.keras.Model()
  >>> model.compile('sgd', loss=tfa.losses.GIoULoss())
  
  Args:
    mode: one of ['giou', 'iou'], decided to calculate GIoU or IoU loss.
code: def __init__(
      self,
      mode: str = "giou",
      reduction: str = tf.keras.losses.Reduction.AUTO,
      name: Optional[str] = "giou_loss",
  ):
      super().__init__(
          giou_loss, name=name, reduction=reduction, mode=mode
      )
  
file_path: addons/tensorflow_addons/losses/giou_loss.py
imports: from typing import Optional
  import tensorflow
  from typeguard import typechecked
  from tensorflow_addons.utils.keras_utils import LossFunctionWrapper
  from tensorflow_addons.utils.types import TensorLike
label_desc: Use image node_id 1 to create a new GIoULoss object from inherited base classes: LossFunctionWrapper with example: obj = GIoULoss(mode, reduction, name)