code: def test_covariance_shape_and_zero_covariance(self):
      cov_reducer = covariance_reducer.CovarianceReducer(event_ndims=1)
      state = cov_reducer.initialize(tf.ones((9, 3)))
      for _ in range(2):
          state = cov_reducer.one_step(
              tf.zeros((5, 9, 3)), state, axis=0
          )
      final_num_samples, final_mean, final_cov = self.evaluate(
          [
              state.cov_state.num_samples,
              state.cov_state.mean,
              cov_reducer.finalize(state),
          ]
      )
      self.assertEqual((9, 3), final_mean.shape)
      self.assertEqual((9, 3, 3), final_cov.shape)
      self.assertEqual(10, final_num_samples)
      self.assertAllEqual(tf.zeros((9, 3)), final_mean)
      self.assertAllEqual(tf.zeros((9, 3, 3)), final_cov)
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.experimental.mcmc import covariance_reducer
  from tensorflow_probability.python.experimental.mcmc.internal import test_fixtures
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling the CovarianceReducersTest obj's underlying member method code with example usage: obj.test_covariance_shape_and_zero_covariance() without return types