code: def test_tf_data_compatibility(self):
      layer = layers.RandomCrop(8, 9)
      if backend.config.image_data_format() == "channels_last":
          input_shape = (2, 10, 12, 3)
          output_shape = (2, 8, 9, 3)
      else:
          input_shape = (2, 3, 10, 12)
          output_shape = (2, 3, 8, 9)
      input_data = np.random.random(input_shape)
      ds = (
          tf_data.Dataset.from_tensor_slices(input_data)
          .batch(2)
          .map(layer)
      )
      for output in ds.take(1):
          output = output.numpy()
      self.assertEqual(tuple(output.shape), output_shape)
  
file_path: keras/keras/layers/preprocessing/random_crop_test.py
imports: import numpy
  from tensorflow import data
  from keras import backend
  from keras import layers
  from keras import testing
label_desc: Use image node_id 6 for calling the RandomCropTest obj's underlying member method code with example usage: obj.test_tf_data_compatibility() without return types