code: def iou(boxlist1, boxlist2, scope=None):
      """Computes pairwise intersection-over-union between box collections.
  
      Args:
        boxlist1: BoxList holding N boxes
        boxlist2: BoxList holding M boxes
        scope: name scope.
  
      Returns:
        a tensor with shape [N, M] representing pairwise iou scores.
      """
      with tf.name_scope(scope, "IOU"):
          intersections = intersection(boxlist1, boxlist2)
          areas1 = area(boxlist1)
          areas2 = area(boxlist2)
          unions = (
              tf.expand_dims(areas1, 1)
              + tf.expand_dims(areas2, 0)
              - intersections
          )
          return tf.where(
              tf.equal(intersections, 0.0),
              tf.zeros_like(intersections),
              tf.truediv(intersections, unions),
          )
  
file_path: DALI/docs/examples/use_cases/tensorflow/efficientdet/pipeline/anchors_utils/region_similarity_calculator.py
imports: from abc import ABCMeta
  from abc import abstractmethod
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: iou(boxlist1, boxlist2, scope) and returns: tf