code: def test_tf_data_compatibility(self):
      if backend.config.image_data_format() == "channels_last":
          input_shape = (1, 5, 5, 1)
      else:
          input_shape = (1, 1, 5, 5)
      input_image = np.reshape(np.arange(0, 25), input_shape)
      layer = layers.RandomZoom(
          height_factor=(0.5, 0.5),
          width_factor=(0.8, 0.8),
          interpolation="nearest",
          fill_mode="constant",
      )
      ds = (
          tf_data.Dataset.from_tensor_slices(input_image)
          .batch(1)
          .map(layer)
      )
      expected_output = np.asarray(
          [
              [0, 0, 0, 0, 0],
              [0, 5, 7, 9, 0],
              [0, 10, 12, 14, 0],
              [0, 20, 22, 24, 0],
              [0, 0, 0, 0, 0],
          ]
      ).reshape(input_shape)
      for output in ds.take(1):
          output = output.numpy()
      self.assertAllClose(expected_output, output)
  
file_path: keras/keras/layers/preprocessing/random_zoom_test.py
imports: import numpy
  import pytest
  from absl.testing import parameterized
  from tensorflow import data
  from keras import backend
  from keras import layers
  from keras import models
  from keras import testing
label_desc: Use image node_id 4 for calling the RandomZoomTest obj's underlying member method code with example usage: obj.test_tf_data_compatibility() without return types