code: def _testSuffStats(self, x_shape, axes, shift, keep_dims, has_shape):
      x_val = np.random.random_sample(x_shape).astype(np.float32)
      np_c, np_m, np_v, np_s = self._npSuffStats(
          x_val, axes, shift, keep_dims
      )
      for use_gpu in [True, False]:
          with self.cached_session(use_gpu=use_gpu) as sess:
              if has_shape:
                  x = constant_op.constant(x_val, name="x")
                  x.set_shape(x_shape)
                  op_c, op_m, op_v, op_s = self._opSuffStats(
                      x, axes, shift, keep_dims
                  )
                  if shift:
                      tf_c, tf_m, tf_v, tf_s = self.evaluate(
                          [op_c, op_m, op_v, op_s]
                      )
                  else:
                      tf_c, tf_m, tf_v = self.evaluate(
                          [op_c, op_m, op_v]
                      )
              else:
                  x = array_ops.placeholder(
                      dtype=dtypes.float32,
                      shape=[None] * len(x_shape),
                      name="x",
                  )
                  op_c, op_m, op_v, op_s = self._opSuffStats(
                      x, axes, shift, keep_dims
                  )
                  if shift:
                      tf_c, tf_m, tf_v, tf_s = sess.run(
                          [op_c, op_m, op_v, op_s], feed_dict={x: x_val}
                      )
                  else:
                      tf_c, tf_m, tf_v = sess.run(
                          [op_c, op_m, op_v], feed_dict={x: x_val}
                      )
              self.assertAllClose(np_c, tf_c, atol=0.000001)
              self.assertAllClose(np_m, tf_m, atol=0.000001)
              self.assertAllClose(np_v, tf_v, atol=0.000001)
              if shift:
                  self.assertAllClose(np_s, tf_s, atol=0.000001)
  
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 3 for calling the SufficientStatisticsTest obj's underlying member method code with example usage: obj._testSuffStats(x_shape, axes, shift, keep_dims, has_shape) without return types