code: def test_nested_with_batching_and_chunking(self):
      cov_reducer = covariance_reducer.CovarianceReducer(event_ndims=1)
      chain_state = (
          {"one": tf.ones((3, 4)), "zero": tf.zeros((3, 4))},
          {"two": tf.ones((3, 4)) * 2},
      )
      state = cov_reducer.initialize(chain_state)
      _, state = tf.while_loop(
          lambda i, _: i < 10,
          lambda i, s: (i + 1, cov_reducer.one_step(chain_state, s, 0)),
          (0.0, state),
      )
      final_cov = self.evaluate(cov_reducer.finalize(state))
      self.assertAllEqualNested(
          final_cov,
          (
              {"one": tf.zeros((3, 4, 4)), "zero": tf.zeros((3, 4, 4))},
              {"two": tf.zeros((3, 4, 4))},
          ),
      )
  
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 4 for calling the CovarianceReducersTest obj's underlying member method code with example usage: obj.test_nested_with_batching_and_chunking() without return types