code: def make_label(
      *, extra_dims=(), categories=10, dtype=torch.int64, device="cpu"
  ):
      categories, num_categories = _parse_categories(categories)
      # The idiom `make_tensor(..., dtype=torch.int64).to(dtype)` is intentional to only get integer values,
      # regardless of the requested dtype, e.g. 0 or 0.0 rather than 0 or 0.123
      data = torch.testing.make_tensor(
          extra_dims,
          low=0,
          high=num_categories,
          dtype=torch.int64,
          device=device,
      ).to(dtype)
      return tv_tensors.Label(data, categories=categories)
  
imports: import collections.abc
  import re
  import PIL.Image
  import pytest
  import torch
  from common_utils import assert_equal, make_bounding_boxes, make_detection_masks, make_image, make_video
  from torchvision.prototype import transforms, tv_tensors
  from torchvision.transforms.v2._utils import check_type, is_pure_tensor
  from torchvision.transforms.v2.functional import clamp_bounding_boxes, InterpolationMode, pil_to_tensor, to_pil_image
  from torchvision.tv_tensors import BoundingBoxes, BoundingBoxFormat, Image, Mask, Video
  import importlib.machinery
  import importlib.util
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: make_label() and returns: tv_tensors