code: def test_nested_reducers(self):
      fake_kernel = test_fixtures.TestTransitionKernel()
      fake_reducer = test_fixtures.TestReducer()
      mean_reducer = test_fixtures.NaiveMeanReducer()
      cov_reducer = covariance_reducer.CovarianceReducer()
      reducer_kernel = with_reductions.WithReductions(
          inner_kernel=fake_kernel,
          reducer=[[mean_reducer, cov_reducer], [fake_reducer]],
      )
  
      (
          chain_state,
          kernel_results,
      ) = 0.0, reducer_kernel.bootstrap_results(0.0)
      for _ in range(6):
          chain_state, kernel_results = reducer_kernel.one_step(
              chain_state, kernel_results
          )
  
      final_cov, final_mean = self.evaluate(
          [
              cov_reducer.finalize(
                  kernel_results.reduction_results[0][1]
              ),
              mean_reducer.finalize(
                  kernel_results.reduction_results[0][0]
              ),
          ]
      )
      self.assertLen(kernel_results.reduction_results, 2)
      self.assertLen(kernel_results.reduction_results[0], 2)
      self.assertLen(kernel_results.reduction_results[1], 1)
  
      self.assertEqual(3.5, final_mean)
      self.assertAllEqual(
          3.5, kernel_results.reduction_results[0][1].cov_state.mean
      )
      self.assertAllEqual(6, kernel_results.reduction_results[1][0])
      self.assertNear(
          np.cov(np.arange(1, 7), ddof=0).tolist(), final_cov, err=1e-6
      )
      self.assertAllEqual(6, kernel_results.inner_results.counter_1)
      self.assertAllEqual(12, kernel_results.inner_results.counter_2)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.experimental.mcmc import covariance_reducer
  from tensorflow_probability.python.experimental.mcmc import step
  from tensorflow_probability.python.experimental.mcmc import with_reductions
  from tensorflow_probability.python.experimental.mcmc.internal import test_fixtures
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import sample
  from tensorflow_probability.python.mcmc import simple_step_size_adaptation
  from tensorflow_probability.python.mcmc import transformed_kernel
label_desc: Use image node_id 9 for calling the CovarianceWithReductionsTest obj's underlying member method code with example usage: obj.test_nested_reducers() without return types