code: def box_iou(boxes1, boxes2):
      area1 = box_area(boxes1)
      area2 = box_area(boxes2)
  
      lt = torch.max(boxes1[:, None, :2], boxes2[:, :2])  # [N,M,2]
      rb = torch.min(boxes1[:, None, 2:], boxes2[:, 2:])  # [N,M,2]
  
      wh = (rb - lt).clamp(min=0)  # [N,M,2]
      inter = wh[:, :, 0] * wh[:, :, 1]  # [N,M]
  
      union = area1[:, None] + area2 - inter
  
      iou = inter / union
      return iou, union
  
imports: from collections import OrderedDict
  import torch
  from torch import nn
  from torch.jit.annotations import Dict
  from torch.nn import functional
label_desc: Use image node_id 12 for calling a global function with example usage: box_iou(boxes1, boxes2) and returns: iou,  union