code: def _testBatchNormArbitraryShapes(
      self,
      x_shape,
      param_shape,
      atol=0.0001,
      dtype=dtypes.float32,
      param_dtype=dtypes.float32,
  ):
      numpy_dtype = dtype.as_numpy_dtype
      numpy_param_dtype = param_dtype.as_numpy_dtype
      x_val = np.random.random_sample(x_shape).astype(numpy_dtype)
      m_val = np.random.random_sample(param_shape).astype(
          numpy_param_dtype
      )
      v_val = np.random.random_sample(param_shape).astype(
          numpy_param_dtype
      )
      beta_val = np.random.random_sample(param_shape).astype(
          numpy_param_dtype
      )
      gamma_val = np.random.random_sample(param_shape).astype(
          numpy_param_dtype
      )
      for use_gpu in [True, False]:
          with self.cached_session(use_gpu=use_gpu) as sess:
              x = constant_op.constant(x_val, name="x")
              m = constant_op.constant(m_val, name="m")
              v = constant_op.constant(v_val, name="v")
              beta = constant_op.constant(beta_val, name="beta")
              gamma = constant_op.constant(gamma_val, name="gamma")
              epsilon = 0.001
              for scale_after_normalization in [True, False]:
                  for shift_after_normalization in [True, False]:
                      bn = self._tfBatchNormV2(
                          x,
                          m,
                          v,
                          beta,
                          gamma,
                          epsilon,
                          scale_after_normalization,
                          shift_after_normalization,
                      )
                      np_batch_norm = self._npBatchNorm(
                          x_val,
                          m_val,
                          v_val,
                          beta_val,
                          gamma_val,
                          epsilon,
                          scale_after_normalization,
                          shift_after_normalization,
                      )
                      [tf_batch_norm] = self.evaluate([bn])
                      self.assertEqual(x_shape, np_batch_norm.shape)
                      self.assertEqual(x_shape, tf_batch_norm.shape)
                      self.assertAllClose(
                          np_batch_norm, tf_batch_norm, atol=atol
                      )
  
imports: import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_impl
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 16 for calling the BatchNormalizationTest obj's underlying member method code with example usage: obj._testBatchNormArbitraryShapes(x_shape, param_shape, atol, dtype, param_dtype) without return types