code: def random_boxes(num_boxes, max_coord=100, device="cpu"):
      """
      Create a random Nx4 boxes tensor, with coordinates < max_coord.
      """
      boxes = torch.rand(num_boxes, 4, device=device) * (
          max_coord * 0.5
      )
      boxes.clamp_(
          min=1.0
      )  # tiny boxes cause numerical instability in box regression
      # Note: the implementation of this function in torchvision is:
      # boxes[:, 2:] += torch.rand(N, 2) * 100
      # but it does not guarantee non-negative widths/heights constraints:
      # boxes[:, 2] >= boxes[:, 0] and boxes[:, 3] >= boxes[:, 1]:
      boxes[:, 2:] += boxes[:, :2]
      return boxes
  
imports: import io
  import numpy
  import os
  import re
  import tempfile
  import unittest
  from typing import Callable
  import torch
  import torch.onnx.symbolic_helper
  from packaging import version
  from torch._C import ListType
  from torch.onnx import register_custom_op_symbolic
  from detectron2 import model_zoo
  from detectron2.config import CfgNode, LazyConfig, instantiate
  from detectron2.data import DatasetCatalog
  from detectron2.data.detection_utils import read_image
  from detectron2.modeling import build_model
  from detectron2.structures import Boxes, Instances, ROIMasks
  from detectron2.utils.file_io import PathManager
label_desc: Use image node_id 2 for calling a global function with example usage: random_boxes(num_boxes, max_coord, device) and returns: boxes