code: def test_normalization_adapt(self, input_type):
      x = np.random.random((32, 4))
      if input_type == "np":
          data = x
      elif input_type == "tensor":
          data = backend.convert_to_tensor(x)
      elif input_type == "tf.data":
          data = tf_data.Dataset.from_tensor_slices(x).batch(8)
  
      layer = layers.Normalization()
      layer.adapt(data)
      self.assertTrue(layer.built)
      output = layer(x)
      output = backend.convert_to_numpy(output)
      self.assertAllClose(np.var(output, axis=0), 1.0, atol=1e-5)
      self.assertAllClose(np.mean(output, axis=0), 0.0, atol=1e-5)
  
      # Test in high-dim and with tuple axis.
      x = np.random.random((32, 4, 3, 5))
      if input_type == "np":
          data = x
      elif input_type == "tensor":
          data = backend.convert_to_tensor(x)
      elif input_type == "tf.data":
          data = tf_data.Dataset.from_tensor_slices(x).batch(8)
  
      layer = layers.Normalization(axis=(1, 2))
      layer.adapt(data)
      self.assertTrue(layer.built)
      output = layer(x)
      output = backend.convert_to_numpy(output)
      self.assertAllClose(np.var(output, axis=(0, 3)), 1.0, atol=1e-5)
      self.assertAllClose(np.mean(output, axis=(0, 3)), 0.0, atol=1e-5)
  
file_path: keras/keras/layers/preprocessing/normalization_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 testing
label_desc: Use image node_id 2 for calling the NormalizationTest obj's underlying member method code with example usage: obj.test_normalization_adapt(input_type) without return types