code: def test_layer_normalization(self):
      # Create a mlp with layer normalization
      with tf.compat.v1.variable_scope("MLP_Concat"):
          self.mlp_f_w_n = mlp(
              input_var=self._obs_input,
              output_dim=self._output_shape,
              hidden_sizes=(32, 32),
              input_var2=self._act_input,
              concat_layer=0,
              hidden_nonlinearity=self.hidden_nonlinearity,
              name="mlp2",
              layer_normalization=True,
          )
  
      # Initialize the new mlp variables
      self.sess.run(tf.compat.v1.global_variables_initializer())
  
      with tf.compat.v1.variable_scope("MLP_Concat", reuse=True):
          h1_w = tf.compat.v1.get_variable("mlp2/hidden_0/kernel")
          h1_b = tf.compat.v1.get_variable("mlp2/hidden_0/bias")
          h2_w = tf.compat.v1.get_variable("mlp2/hidden_1/kernel")
          h2_b = tf.compat.v1.get_variable("mlp2/hidden_1/bias")
          out_w = tf.compat.v1.get_variable("mlp2/output/kernel")
          out_b = tf.compat.v1.get_variable("mlp2/output/bias")
  
      with tf.compat.v1.variable_scope(
          "MLP_Concat_1", reuse=True
      ) as vs:
          gamma_1, beta_1, gamma_2, beta_2 = vs.global_variables()
  
      # First layer
      y = (
          tf.matmul(
              tf.concat([self._obs_input, self._act_input], 1), h1_w
          )
          + h1_b
      )
      y = self.hidden_nonlinearity(y)
      mean, variance = tf.nn.moments(y, [1], keepdims=True)
      normalized_y = (y - mean) / tf.sqrt(variance + 1e-12)
      y_out = normalized_y * gamma_1 + beta_1
  
      # Second layer
      y = tf.matmul(y_out, h2_w) + h2_b
      y = self.hidden_nonlinearity(y)
      mean, variance = tf.nn.moments(y, [1], keepdims=True)
      normalized_y = (y - mean) / tf.sqrt(variance + 1e-12)
      y_out = normalized_y * gamma_2 + beta_2
  
      # Output layer
      y = tf.matmul(y_out, out_w) + out_b
  
      out = self.sess.run(
          y,
          feed_dict={
              self._obs_input: self.obs_input,
              self._act_input: self.act_input,
          },
      )
      mlp_output = self.sess.run(
          self.mlp_f_w_n,
          feed_dict={
              self._obs_input: self.obs_input,
              self._act_input: self.act_input,
          },
      )
  
      np.testing.assert_array_almost_equal(out, mlp_output, decimal=2)
  
file_path: garage/tests/garage/tf/models/test_mlp_concat.py
imports: import numpy
  import pytest
  import tensorflow
  from garage.tf.models.mlp import mlp
  from tests.fixtures import TfGraphTestCase
label_desc: Use image node_id 6 for calling the TestMLPConcat obj's underlying member method code with example usage: obj.test_layer_normalization() without return types