code: def testSampleUnbiasedNonScalarBatch(self):
      with self.cached_session() as sess:
          dist = ds.DirichletMultinomial(
              total_count=5.0,
              concentration=1.0
              + 2.0 * self._rng.rand(4, 3, 2).astype(np.float32),
          )
          n = int(3e3)
          x = dist.sample(n, seed=0)
          sample_mean = math_ops.reduce_mean(x, 0)
          # Cyclically rotate event dims left.
          x_centered = array_ops.transpose(
              x - sample_mean, [1, 2, 3, 0]
          )
          sample_covariance = (
              math_ops.matmul(x_centered, x_centered, adjoint_b=True)
              / n
          )
          [
              sample_mean_,
              sample_covariance_,
              actual_mean_,
              actual_covariance_,
          ] = sess.run(
              [
                  sample_mean,
                  sample_covariance,
                  dist.mean(),
                  dist.covariance(),
              ]
          )
          self.assertAllEqual([4, 3, 2], sample_mean.get_shape())
          self.assertAllClose(
              actual_mean_, sample_mean_, atol=0.0, rtol=0.20
          )
          self.assertAllEqual(
              [4, 3, 2, 2], sample_covariance.get_shape()
          )
          self.assertAllClose(
              actual_covariance_,
              sample_covariance_,
              atol=0.0,
              rtol=0.20,
          )
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.distributions import dirichlet_multinomial
  from tensorflow.python.platform import test
label_desc: Use image node_id 25 for calling the DirichletMultinomialTest obj's underlying member method code with example usage: obj.testSampleUnbiasedNonScalarBatch() without return types