docstr: Test case for batch_norm layer
docstr_tok: ["Test","case","for","batch_norm","layer"]
code: def test_param_sharing_with_batch_norm(self):
      """
      Test case for batch_norm layer
      """
      net = MyNetWork()
  
      main_program1 = fluid.Program()
      with fluid.program_guard(main_program1):
          x = layers.data(
              name="x", shape=[32, 128, 128], dtype="float32"
          )
          hid1 = net.fc1(x)
          out1 = net.batch_norm(hid1)
  
      main_program2 = fluid.Program()
      with fluid.program_guard(main_program2):
          x = layers.data(
              name="x", shape=[32, 128, 128], dtype="float32"
          )
          hid1 = net.fc1(x)
          out2 = net.batch_norm(hid1)
  
      place = fluid.CPUPlace()
      exe = fluid.Executor(place)
      exe.run(fluid.default_startup_program())
  
      input_np = np.random.uniform(0, 1, [1, 32, 128, 128]).astype(
          "float32"
      )
      out1_np = exe.run(
          main_program1, feed={"x": input_np}, fetch_list=[out1]
      )[0]
      out2_np = exe.run(
          main_program2, feed={"x": input_np}, fetch_list=[out2]
      )[0]
      self.assertEqual(
          np.sum(out1_np.flatten()), np.sum(out2_np.flatten())
      )
  
file_path: PARL/parl/core/fluid/layers/tests/param_sharing_test_fluid.py
imports: import numpy
  import paddle.fluid
  import parl
  import unittest
  from parl import layers
label_desc: Use image node_id 3 for calling the TestParamSharing obj's underlying member method code with example usage: obj.test_param_sharing_with_batch_norm() without return types