original_docstring: Computing pairwise Intersection Over Union (IOU)
      As we will see later in the example, we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping. 
      This will require us to calculate the Intersection Over Union (IOU) between all the anchor boxes and ground truth boxes pairs.
      
      Computes pairwise IOU matrix for given two sets of boxes
  
      Arguments:
        boxes1: A tensor with shape `(N, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
          boxes2: A tensor with shape `(M, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
  
      Returns:
        pairwise IOU matrix with shape `(N, M)`, where the value at ith row
          jth column holds the IOU between ith box and jth box from
          boxes1 and boxes2 respectively.
      
docstring: Computing pairwise Intersection Over Union (IOU)
  As we will see later in the example, we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping.
  This will require us to calculate the Intersection Over Union (IOU) between all the anchor boxes and ground truth boxes pairs.
  
  Computes pairwise IOU matrix for given two sets of boxes
docstring_tokens: Computing pairwise Intersection Over Union ( IOU ) As we will see later in the example we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping . This will require us to calculate the Intersection Over Union ( IOU ) between all the anchor boxes and ground truth boxes pairs . Computes pairwise IOU matrix for given two sets of boxes
code: def compute_iou(boxes1, boxes2):
      """Computing pairwise Intersection Over Union (IOU)
      As we will see later in the example, we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping. 
      This will require us to calculate the Intersection Over Union (IOU) between all the anchor boxes and ground truth boxes pairs.
      
      Computes pairwise IOU matrix for given two sets of boxes
  
      Arguments:
        boxes1: A tensor with shape `(N, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
          boxes2: A tensor with shape `(M, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
  
      Returns:
        pairwise IOU matrix with shape `(N, M)`, where the value at ith row
          jth column holds the IOU between ith box and jth box from
          boxes1 and boxes2 respectively.
      """
      boxes1_corners = convert_to_corners(boxes1)
      boxes2_corners = convert_to_corners(boxes2)
      lu = tf.maximum(boxes1_corners[:, None, :2], boxes2_corners[:, :2])   # left up, None is for add a dimension, boxes2 could broadcast directly
      rd = tf.minimum(boxes1_corners[:, None, 2:], boxes2_corners[:, 2:])   # right down
      intersection = tf.maximum(0.0, rd - lu)
      intersection_area = intersection[:, :, 0] * intersection[:, :, 1]
      boxes1_area = boxes1[:, 2] * boxes1[:, 3]
      boxes2_area = boxes2[:, 2] * boxes2[:, 3]
      union_area = tf.maximum(
          boxes1_area[:, None] + boxes2_area - intersection_area, 1e-8
      )
      return tf.clip_by_value(intersection_area / union_area, 0.0, 1.0)
code_tokens: def compute_iou ( boxes1 , boxes2 ) : boxes1_corners = convert_to_corners ( boxes1 ) boxes2_corners = convert_to_corners ( boxes2 ) lu = tf . maximum ( boxes1_corners [ : , None , : 2 ] , boxes2_corners [ : , : 2 ] ) rd = tf . minimum ( boxes1_corners [ : , None , 2 : ] , boxes2_corners [ : , 2 : ] ) intersection = tf . maximum ( 0.0 , rd - lu ) intersection_area = intersection [ : , : , 0 ] * intersection [ : , : , 1 ] boxes1_area = boxes1 [ : , 2 ] * boxes1 [ : , 3 ] boxes2_area = boxes2 [ : , 2 ] * boxes2 [ : , 3 ] union_area = tf . maximum ( boxes1_area [ : , None ] + boxes2_area - intersection_area , 1e-8 ) return tf . clip_by_value ( intersection_area / union_area , 0.0 , 1.0 )
short_docstring: Computing pairwise Intersection Over Union (IOU)
  As we will see later in the example, we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping.
short_docstring_tokens: Computing pairwise Intersection Over Union ( IOU ) As we will see later in the example we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping .
comment: """Computing pairwise Intersection Over Union (IOU)
      As we will see later in the example, we would be assigning ground truth boxes to anchor boxes based on the extent of overlapping. 
      This will require us to calculate the Intersection Over Union (IOU) between all the anchor boxes and ground truth boxes pairs.
      
      Computes pairwise IOU matrix for given two sets of boxes
  
      Arguments:
        boxes1: A tensor with shape `(N, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
          boxes2: A tensor with shape `(M, 4)` representing bounding boxes
          where each box is of the format `[x, y, width, height]`.
  
      Returns:
        pairwise IOU matrix with shape `(N, M)`, where the value at ith row
          jth column holds the IOU between ith box and jth box from
          boxes1 and boxes2 respectively.
      """$SEP$# left up, None is for add a dimension, boxes2 could broadcast directly$SEP$# right down