code: def test_scalar_variate_stats(self):
      new_batch_shape = [2, 2]
      old_batch_shape = [4]
  
      normal, reshape_normal = self.make_normal(
          new_batch_shape, old_batch_shape
      )
  
      expected_scalar_stat_shape = new_batch_shape
  
      expected_entropy = tf.reshape(
          normal.entropy(), expected_scalar_stat_shape
      )
      actual_entropy = reshape_normal.entropy()
  
      expected_mean = tf.reshape(
          normal.mean(), expected_scalar_stat_shape
      )
      actual_mean = reshape_normal.mean()
  
      expected_mode = tf.reshape(
          normal.mode(), expected_scalar_stat_shape
      )
      actual_mode = reshape_normal.mode()
  
      expected_stddev = tf.reshape(
          normal.stddev(), expected_scalar_stat_shape
      )
      actual_stddev = reshape_normal.stddev()
  
      expected_variance = tf.reshape(
          normal.variance(), expected_scalar_stat_shape
      )
      actual_variance = reshape_normal.variance()
  
      [
          expected_entropy_,
          actual_entropy_,
          expected_mean_,
          actual_mean_,
          expected_mode_,
          actual_mode_,
          expected_stddev_,
          actual_stddev_,
          expected_variance_,
          actual_variance_,
      ] = self.evaluate(
          [
              expected_entropy,
              actual_entropy,
              expected_mean,
              actual_mean,
              expected_mode,
              actual_mode,
              expected_stddev,
              actual_stddev,
              expected_variance,
              actual_variance,
          ]
      )
      self.assertAllClose(
          expected_entropy_, actual_entropy_, atol=0.0, rtol=1e-6
      )
      self.assertAllClose(
          expected_mean_, actual_mean_, atol=0.0, rtol=1e-6
      )
      self.assertAllClose(
          expected_mode_, actual_mode_, atol=0.0, rtol=1e-6
      )
      self.assertAllClose(
          expected_stddev_, actual_stddev_, atol=0.0, rtol=1e-6
      )
      self.assertAllClose(
          expected_variance_, actual_variance_, atol=0.0, rtol=1e-6
      )
      if not self.is_static_shape:
          return
      self.assertAllEqual(
          expected_scalar_stat_shape, actual_entropy.shape
      )
      self.assertAllEqual(expected_scalar_stat_shape, actual_mean.shape)
      self.assertAllEqual(expected_scalar_stat_shape, actual_mode.shape)
      self.assertAllEqual(
          expected_scalar_stat_shape, actual_stddev.shape
      )
      self.assertAllEqual(
          expected_scalar_stat_shape, actual_variance.shape
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.distributions import batch_reshape
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions import triangular
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.distributions import wishart
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 6 for calling the _BatchReshapeTest obj's underlying member method code with example usage: obj.test_scalar_variate_stats() without return types