code: def test_resize_image(
      resize_image_fn: Callable,
      img: torch.Tensor,
      new_size: int,
      resize_method: str,
  ):
      # Get the expected output from the underlying function
      if resize_method == "crop_or_pad":
          expected_img = crop_or_pad(img, new_size)
      else:
          expected_img = F.resize(img, new_size)
  
      output_img = resize_image_fn(img, new_size, resize_method)
  
      # Test that resize_image is equivalent to the underlying function output
      assert torch.equal(output_img, expected_img)
  
file_path: ludwig/tests/ludwig/utils/test_image_utils.py
imports: from typing import Callable
  import pytest
  import torch
  import torchvision.transforms.functional
  from ludwig.utils.image_utils import crop, crop_or_pad, grayscale, is_image_score, num_channels_in_image, pad, read_image_as_tif, resize_image, ResizeChannels
label_desc: Use image node_id 4 for calling a global function with example usage: test_resize_image(resize_image_fn, img, new_size, resize_method) without return types