code: def _box_inter_union(
      boxes1_t: torch.Tensor,
      boxes2_t: torch.Tensor,
      compute_dtype: torch.dtype = torch.float32,
  ) -> tuple[torch.Tensor, torch.Tensor]:
      """
      This internal function computes the intersection and union area of two set of boxes.
  
      Args:
          boxes1: bounding boxes, Nx4 or Nx6 torch tensor. The box mode is assumed to be ``StandardMode``
          boxes2: bounding boxes, Mx4 or Mx6 torch tensor. The box mode is assumed to be ``StandardMode``
          compute_dtype: default torch.float32, dtype with which the results will be computed
  
      Returns:
          inter, with size of (N,M) and dtype of ``compute_dtype``.
          union, with size of (N,M) and dtype of ``compute_dtype``.
  
      """
      spatial_dims = get_spatial_dims(boxes=boxes1_t)
  
      # compute area with float32
      area1 = box_area(boxes=boxes1_t.to(dtype=compute_dtype))  # (N,)
      area2 = box_area(boxes=boxes2_t.to(dtype=compute_dtype))  # (M,)
  
      # get the left top and right bottom points for the NxM combinations
      lt = torch.max(
          boxes1_t[:, None, :spatial_dims], boxes2_t[:, :spatial_dims]
      ).to(
          dtype=compute_dtype
      )  # (N,M,spatial_dims) left top
      rb = torch.min(
          boxes1_t[:, None, spatial_dims:], boxes2_t[:, spatial_dims:]
      ).to(
          dtype=compute_dtype
      )  # (N,M,spatial_dims) right bottom
  
      # compute size for the intersection region for the NxM combinations
      wh = (rb - lt + TO_REMOVE).clamp(min=0)  # (N,M,spatial_dims)
      inter = torch.prod(wh, dim=-1, keepdim=False)  # (N,M)
  
      union = area1[:, None] + area2 - inter
      return inter, union
  
imports: from __future__ import annotations
  import inspect
  import warnings
  from abc import ABC, abstractmethod
  from collections.abc import Callable, Sequence
  from copy import deepcopy
  import numpy
  import torch
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor
  from monai.utils import look_up_option
  from monai.utils.enums import BoxModeName
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 11 for calling a global function with example usage: _box_inter_union(boxes1_t, boxes2_t, compute_dtype) and returns: inter,  union