code: def testSampleUnbiasedScalarBatch(self):
      seed_stream = test_util.test_seed_stream()
      concentration = 1.0 + 2.0 * tf.random.uniform(
          shape=[4], dtype=np.float32, seed=seed_stream()
      )
      dist = dm.DirichletMultinomial(
          total_count=5.0,
          concentration=concentration,
          validate_args=True,
      )
      n = int(1e4)
      x = dist.sample(n, seed=seed_stream())
      sample_mean = tf.reduce_mean(x, axis=0)
      x_centered = x - sample_mean  # Already transposed to [n, 2].
      sample_covariance = (
          tf.linalg.matmul(x_centered, x_centered, adjoint_a=True) / n
      )
      [
          x_,
          sample_covariance_,
          actual_mean_,
          actual_covariance_,
      ] = self.evaluate(
          [
              x,
              sample_covariance,
              dist.mean(),
              dist.covariance(),
          ]
      )
      self.assertAllEqual([4], sample_mean.shape)
      self.assertAllMeansClose(
          x_, actual_mean_, axis=0, atol=0.0, rtol=0.25
      )
      self.assertAllEqual([4, 4], sample_covariance.shape)
      self.assertAllClose(
          actual_covariance_, sample_covariance_, atol=0.0, rtol=0.25
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import dirichlet_multinomial
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 26 for calling the DirichletMultinomialTest obj's underlying member method code with example usage: obj.testSampleUnbiasedScalarBatch() without return types