code: def test_image_sizes(device, fn):
      script_F = torch.jit.script(fn)
  
      img_tensor, pil_img = _create_data(16, 18, 3, device=device)
      value_img = fn(img_tensor)
      value_pil_img = fn(pil_img)
      assert value_img == value_pil_img
  
      value_img_script = script_F(img_tensor)
      assert value_img == value_img_script
  
      batch_tensors = _create_data_batch(
          16, 18, 3, num_samples=4, device=device
      )
      value_img_batch = fn(batch_tensors)
      assert value_img == value_img_batch
  
imports: import colorsys
  import itertools
  import math
  import os
  from functools import partial
  from typing import Sequence
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torchvision.transforms
  import torchvision.transforms._functional_pil
  import torchvision.transforms._functional_tensor
  import torchvision.transforms.functional
  from common_utils import _assert_approx_equal_tensor_to_pil, _assert_equal_tensor_to_pil, _create_data, _create_data_batch, _test_fn_on_batch, assert_equal, cpu_and_cuda, needs_cuda
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 1 for calling a global function with example usage: test_image_sizes(device, fn) without return types