code: def test_consistent_resize(self):
      spatial_size = (16, 16, 16)
      rescaler_1 = Resize(
          spatial_size=spatial_size,
          anti_aliasing=True,
          anti_aliasing_sigma=(0.5, 1.0, 2.0),
      )
      rescaler_2 = Resize(
          spatial_size=spatial_size,
          anti_aliasing=True,
          anti_aliasing_sigma=None,
      )
      rescaler_dict = Resized(
          keys=["img1", "img2"],
          spatial_size=spatial_size,
          anti_aliasing=(True, True),
          anti_aliasing_sigma=[(0.5, 1.0, 2.0), None],
      )
      test_input_1 = torch.randn([3, 32, 32, 32])
      test_input_2 = torch.randn([3, 32, 32, 32])
      test_input_dict = {"img1": test_input_1, "img2": test_input_2}
      assert_allclose(
          rescaler_1(test_input_1),
          rescaler_dict(test_input_dict)["img1"],
      )
      assert_allclose(
          rescaler_2(test_input_2),
          rescaler_dict(test_input_dict)["img2"],
      )
  
file_path: MONAI/tests/test_resized.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import skimage.transform
  import torch
  from parameterized import parameterized
  from monai.data import MetaTensor, set_track_meta
  from monai.transforms import Invertd, Resize, Resized
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, NumpyImageTestCase2D, assert_allclose, test_local_inversion
label_desc: Use image node_id 6 for calling the TestResized obj's underlying member method code with example usage: obj.test_consistent_resize() without return types