code: def test_2d_bn_reg_shape(self):
      x = self.get_2d_input()
      bn_layer = BNLayer(regularizer=regularizers.l2_regularizer(0.5))
      out_bn = bn_layer(x, is_training=True)
      test_bn = bn_layer(x, is_training=False)
      print(bn_layer)
      reg_loss = tf.add_n(bn_layer.regularizer_loss())
  
      with self.cached_session() as sess:
          sess.run(tf.global_variables_initializer())
  
          out = sess.run(out_bn)
          x_shape = tuple(x.shape.as_list())
          self.assertAllClose(x_shape, out.shape)
          # self.assertAllClose(np.zeros(x_shape), out)
  
          out = sess.run(test_bn)
          self.assertAllClose(x_shape, out.shape)
          # self.assertAllClose(np.zeros(x_shape), out)
  
          out = sess.run(reg_loss)
          self.assertAlmostEqual(out, 2.0)
  
file_path: NiftyNet/tests/bn_test.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from tensorflow.contrib.layers.python.layers import regularizers
  from niftynet.layer.bn import BNLayer
  from niftynet.layer.bn import InstanceNormLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 8 for calling the BNTest obj's underlying member method code with example usage: obj.test_2d_bn_reg_shape() without return types