docstr: Checks that BatchNormalization falls into a special case of DN.
docstr_tok: ["Checks","that","BatchNormalization","falls","into","a","special","case","of","DN","."]
code: def testDynamicndBatchNormalizationConsistency(self):
      """Checks that BatchNormalization falls into a special case of DN."""
      batch_size = 2
      dm_config = test_util.default_dm_config(
          per_cluster_buffer_size=batch_size,
          distance_to_cluster_threshold=0.5,
          max_num_clusters=1,
          bootstrap_steps=0,
      )
      inputs = np.array([[1, 2], [3, 4]])
      hidden_layer = tf.keras.layers.Dense(
          5, activation="relu", kernel_initializer="ones"
      )(inputs)
  
      batch_norm = tf.keras.layers.BatchNormalization(
          axis=1, center=True, scale=True, momentum=0
      )(hidden_layer, training=True)
      dynamic_norm = dn.DynamicNormalization(
          dm_config,
          mode=dm_ops.LOOKUP_WITH_UPDATE,
          axis=1,
          epsilon=0.001,
          use_batch_normalization=True,
          service_address=self._kbs_address,
      )(hidden_layer, training=True)
  
      self.assertAllClose(batch_norm.numpy(), dynamic_norm.numpy())
  
file_path: neural-structured-learning/research/carls/dynamic_normalization_test.py
imports: from research.carls import context
  from research.carls import dynamic_memory_ops
  from research.carls import dynamic_normalization
  from research.carls.testing import test_util
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling the DynamicNormalizationTest obj's underlying member method code with example usage: obj.testDynamicndBatchNormalizationConsistency() without return types