code: def make_image(
      size=DEFAULT_SIZE,
      *,
      color_space="RGB",
      batch_dims=(),
      dtype=None,
      device="cpu",
      memory_format=torch.contiguous_format,
  ):
      num_channels = NUM_CHANNELS_MAP[color_space]
      dtype = dtype or torch.uint8
      max_value = get_max_value(dtype)
      data = torch.testing.make_tensor(
          (*batch_dims, num_channels, *size),
          low=0,
          high=max_value,
          dtype=dtype,
          device=device,
          memory_format=memory_format,
      )
      if color_space in {"GRAY_ALPHA", "RGBA"}:
          data[..., -1, :, :] = max_value
  
      return tv_tensors.Image(data)
  
imports: import contextlib
  import functools
  import itertools
  import os
  import pathlib
  import random
  import re
  import shutil
  import sys
  import tempfile
  import warnings
  from subprocess import CalledProcessError, check_output, STDOUT
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torch.testing
  from PIL import Image
  from torch.testing._comparison import BooleanPair, NonePair, not_close_error_metas, NumberPair, TensorLikePair
  from torchvision import io, tv_tensors
  from torchvision.transforms._functional_tensor import _max_value
  from torchvision.transforms.v2.functional import to_image, to_pil_image
label_desc: Use image node_id 23 for calling a global function with example usage: make_image(size) and returns: tv_tensors