code: def test_five_crop(device):
      script_five_crop = torch.jit.script(F.five_crop)
  
      img_tensor, pil_img = _create_data(32, 34, device=device)
  
      cropped_pil_images = F.five_crop(pil_img, [10, 11])
  
      cropped_tensors = F.five_crop(img_tensor, [10, 11])
      for i in range(5):
          _assert_equal_tensor_to_pil(
              cropped_tensors[i], cropped_pil_images[i]
          )
  
      cropped_tensors = script_five_crop(img_tensor, [10, 11])
      for i in range(5):
          _assert_equal_tensor_to_pil(
              cropped_tensors[i], cropped_pil_images[i]
          )
  
      batch_tensors = _create_data_batch(
          16, 18, num_samples=4, device=device
      )
      tuple_transformed_batches = F.five_crop(batch_tensors, [10, 11])
      for i in range(len(batch_tensors)):
          img_tensor = batch_tensors[i, ...]
          tuple_transformed_imgs = F.five_crop(img_tensor, [10, 11])
          assert len(tuple_transformed_imgs) == len(
              tuple_transformed_batches
          )
  
          for j in range(len(tuple_transformed_imgs)):
              true_transformed_img = tuple_transformed_imgs[j]
              transformed_img = tuple_transformed_batches[j][i, ...]
              assert_equal(true_transformed_img, transformed_img)
  
      # scriptable function test
      s_tuple_transformed_batches = script_five_crop(
          batch_tensors, [10, 11]
      )
      for transformed_batch, s_transformed_batch in zip(
          tuple_transformed_batches, s_tuple_transformed_batches
      ):
          assert_equal(transformed_batch, s_transformed_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 37 for calling a global function with example usage: test_five_crop(device) without return types