code: def _box_inter_union(
      boxes1: Tensor, boxes2: Tensor
  ) -> Tuple[Tensor, Tensor]:
      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 = _upcast(rb - lt).clamp(min=0)  # [N,M,2]
      inter = wh[:, :, 0] * wh[:, :, 1]  # [N,M]
  
      union = area1[:, None] + area2 - inter
  
      return inter, union
  
imports: from typing import Tuple
  import torch
  import torchvision
  from torch import Tensor
  from torchvision.extension import _assert_has_ops
  from ..utils import _log_api_usage_once
  from ._box_convert import _box_cxcywh_to_xyxy, _box_xywh_to_xyxy, _box_xyxy_to_cxcywh, _box_xyxy_to_xywh
  from ._utils import _upcast
label_desc: Use image node_id 9 for calling a global function with example usage: _box_inter_union(boxes1, boxes2) and returns: inter,  union