code: def test_resized_crop(device, mode):
      # test values of F.resized_crop in several cases:
      # 1) resize to the same size, crop to the same size => should be identity
      tensor, _ = _create_data(26, 36, device=device)
  
      out_tensor = F.resized_crop(
          tensor,
          top=0,
          left=0,
          height=26,
          width=36,
          size=[26, 36],
          interpolation=mode,
          antialias=True,
      )
      assert_equal(
          tensor,
          out_tensor,
          msg=f"{out_tensor[0, :5, :5]} vs {tensor[0, :5, :5]}",
      )
  
      # 2) resize by half and crop a TL corner
      tensor, _ = _create_data(26, 36, device=device)
      out_tensor = F.resized_crop(
          tensor,
          top=0,
          left=0,
          height=20,
          width=30,
          size=[10, 15],
          interpolation=NEAREST,
      )
      expected_out_tensor = tensor[:, :20:2, :30:2]
      assert_equal(
          expected_out_tensor,
          out_tensor,
          msg=f"{expected_out_tensor[0, :10, :10]} vs {out_tensor[0, :10, :10]}",
      )
  
      batch_tensors = _create_data_batch(
          26, 36, num_samples=4, device=device
      )
      _test_fn_on_batch(
          batch_tensors,
          F.resized_crop,
          top=1,
          left=2,
          height=20,
          width=30,
          size=[10, 15],
          interpolation=NEAREST,
      )
  
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 27 for calling a global function with example usage: test_resized_crop(device, mode) without return types