code: def boxes_iou(boxes1, boxes2):
      """
      Compute iou
  
      Args:
          boxes1 (paddle.tensor) shape (N, 4)
          boxes2 (paddle.tensor) shape (M, 4)
  
      Return:
          (paddle.tensor) shape (N, M)
      """
      area1 = box_area(boxes1)
      area2 = box_area(boxes2)
  
      lt = paddle.maximum(boxes1.unsqueeze(-2)[:, :, :2], boxes2[:, :2])
      rb = paddle.minimum(boxes1.unsqueeze(-2)[:, :, 2:], boxes2[:, 2:])
  
      wh = (rb - lt).astype("float32").clip(min=1e-9)
      inter = wh[:, :, 0] * wh[:, :, 1]
  
      union = area1.unsqueeze(-1) + area2 - inter + 1e-9
  
      iou = inter / union
      return iou, union
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from scipy.optimize import linear_sum_assignment
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.metric import accuracy
  from ppdet.core.workspace import register
  from ppdet.modeling.losses.iou_loss import GIoULoss
label_desc: Use image node_id 2 for calling a global function with example usage: boxes_iou(boxes1, boxes2) and returns: iou,  union