code: def testCovarianceMultidimensional(self):
      # Shape [3, 5, 4]
      p = np.random.dirichlet([0.25, 0.25, 0.25, 0.25], [3, 5]).astype(
          np.float32
      )
      # Shape [6, 3, 3]
      p2 = np.random.dirichlet([0.3, 0.3, 0.4], [6, 3]).astype(
          np.float32
      )
  
      ns = np.random.randint(low=1, high=11, size=[3, 5]).astype(
          np.float32
      )
      ns2 = np.random.randint(low=1, high=11, size=[6, 1]).astype(
          np.float32
      )
  
      with self.cached_session():
          dist = multinomial.Multinomial(ns, p)
          dist2 = multinomial.Multinomial(ns2, p2)
  
          covariance = dist.covariance()
          covariance2 = dist2.covariance()
          self.assertEqual((3, 5, 4, 4), covariance.get_shape())
          self.assertEqual((6, 3, 3, 3), covariance2.get_shape())
  
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 multinomial
  from tensorflow.python.platform import test
label_desc: Use image node_id 21 for calling the MultinomialTest obj's underlying member method code with example usage: obj.testCovarianceMultidimensional() without return types