code: def test_running_covariance_with_event_ndims_2(self):
      rng = test_util.test_np_rng()
      x = rng.rand(100, 3, 5, 2)
      cov = sample_stats.RunningCovariance.from_shape(
          tf.TensorShape([3, 5, 2]), event_ndims=2
      )
      cov = consume(cov, x)
      final_mean, final_cov = self.evaluate(
          [cov.mean, cov.covariance()]
      )
      self.assertAllClose(np.mean(x, axis=0), final_mean, rtol=1e-5)
      self.assertEqual(final_cov.shape, (3, 5, 2, 5, 2))
      self.assertEqual(cov.event_ndims, 2)
  
      # check against numpy
      x_reshaped = x.reshape((100, 3, 10))
      for i in range(x_reshaped.shape[1]):
          np_cov = np.cov(x_reshaped[:, i, :].T, ddof=0).reshape(
              (5, 2, 5, 2)
          )
          self.assertAllClose(np_cov, final_cov[i], rtol=1e-5)
  
imports: from absl.testing import parameterized
  import numpy
  import scipy.stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.stats import sample_stats
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import diagnostic
label_desc: Use image node_id 8 for calling the RunningCovarianceTest obj's underlying member method code with example usage: obj.test_running_covariance_with_event_ndims_2() without return types