code: def box3d_overlap_sampling(
      box1: torch.Tensor, box2: torch.Tensor, num_samples: int = 10000
  ):
      """
      Computes the intersection of two boxes by sampling points
      """
      vol1 = box_volume(box1)
      vol2 = box_volume(box2)
  
      points1 = sample_points_within_box(box1, num_samples=num_samples)
      points2 = sample_points_within_box(box2, num_samples=num_samples)
  
      isin21 = is_point_inside_box(box1, points2)
      num21 = isin21.sum()
      isin12 = is_point_inside_box(box2, points1)
      num12 = isin12.sum()
  
      assert num12 <= num_samples
      assert num21 <= num_samples
  
      inters = (vol1 * num12 + vol2 * num21) / 2.0
      union = vol1 * num_samples + vol2 * num_samples - inters
      return inters / union
  
imports: import pickle
  import random
  import unittest
  from typing import List, Tuple, Union
  import torch
  import torch.nn.functional
  from pytorch3d.io import save_obj
  from pytorch3d.ops.iou_box3d import _box_planes, _box_triangles, box3d_overlap
  from pytorch3d.transforms.rotation_conversions import random_rotation
  from .common_testing import get_random_cuda_device, get_tests_dir, TestCaseMixin
label_desc: Use image node_id 18 for calling a global function with example usage: box3d_overlap_sampling(box1, box2, num_samples) and returns: unknown