code: def test_resize(self, interpolation, antialias, data_format):
      if backend.backend() == "torch":
          if "lanczos" in interpolation:
              self.skipTest(
                  "Resizing with Lanczos interpolation is "
                  "not supported by the PyTorch backend. "
                  f"Received: interpolation={interpolation}."
              )
          if interpolation == "bicubic" and antialias is False:
              self.skipTest(
                  "Resizing with Bicubic interpolation in "
                  "PyTorch backend produces noise. Please "
                  "turn on anti-aliasing. "
                  f"Received: interpolation={interpolation}, "
                  f"antialias={antialias}."
              )
      # Unbatched case
      if data_format == "channels_first":
          x = np.random.random((3, 50, 50)) * 255
      else:
          x = np.random.random((50, 50, 3)) * 255
      out = kimage.resize(
          x,
          size=(25, 25),
          interpolation=interpolation,
          antialias=antialias,
          data_format=data_format,
      )
      if data_format == "channels_first":
          x = np.transpose(x, (1, 2, 0))
      ref_out = tf.image.resize(
          x, size=(25, 25), method=interpolation, antialias=antialias
      )
      if data_format == "channels_first":
          ref_out = np.transpose(ref_out, (2, 0, 1))
      self.assertEqual(tuple(out.shape), tuple(ref_out.shape))
      self.assertAllClose(ref_out, out, atol=0.3)
  
      # Batched case
      if data_format == "channels_first":
          x = np.random.random((2, 3, 50, 50)) * 255
      else:
          x = np.random.random((2, 50, 50, 3)) * 255
      out = kimage.resize(
          x,
          size=(25, 25),
          interpolation=interpolation,
          antialias=antialias,
          data_format=data_format,
      )
      if data_format == "channels_first":
          x = np.transpose(x, (0, 2, 3, 1))
      ref_out = tf.image.resize(
          x, size=(25, 25), method=interpolation, antialias=antialias
      )
      if data_format == "channels_first":
          ref_out = np.transpose(ref_out, (0, 3, 1, 2))
      self.assertEqual(tuple(out.shape), tuple(ref_out.shape))
      self.assertAllClose(ref_out, out, atol=0.3)
  
imports: import math
  import numpy
  import pytest
  import scipy.ndimage
  import tensorflow
  from absl.testing import parameterized
  from keras import backend
  from keras import testing
  from keras.backend.common.keras_tensor import KerasTensor
  from keras.ops import image
label_desc: Use image node_id 1 for calling the ImageOpsCorrectnessTest obj's underlying member method code with example usage: obj.test_resize(interpolation, antialias, data_format) without return types