code: def test_multivariate_normal_covariance_with_sample_chain(self):
      mu = [1, 2, 3]
      cov = [
          [0.36, 0.12, 0.06],
          [0.12, 0.29, -0.13],
          [0.06, -0.13, 0.26],
      ]
      target = mvn_tril.MultivariateNormalTriL(
          loc=mu, scale_tril=tf.linalg.cholesky(cov)
      )
      fake_kernel = hmc.HamiltonianMonteCarlo(
          target_log_prob_fn=target.log_prob,
          step_size=1 / 3,
          num_leapfrog_steps=27,
      )
      cov_reducer = covariance_reducer.CovarianceReducer()
      reducer_kernel = with_reductions.WithReductions(
          inner_kernel=fake_kernel,
          reducer=cov_reducer,
      )
      samples, _, kernel_results = sample.sample_chain(
          num_results=20,
          current_state=tf.convert_to_tensor([1.0, 2.0, 3.0]),
          kernel=reducer_kernel,
          trace_fn=None,
          return_final_kernel_results=True,
          seed=test_util.test_seed(sampler_type="stateless"),
      )
      samples, mean, final_cov = self.evaluate(
          [
              samples,
              kernel_results.reduction_results.cov_state.mean,
              cov_reducer.finalize(kernel_results.reduction_results),
          ]
      )
      self.assertAllClose(np.mean(samples, axis=0), mean, rtol=1e-6)
      self.assertAllClose(
          np.cov(samples.T, ddof=0), final_cov, rtol=1e-6
      )
  
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 4 for calling the CovarianceWithReductionsTest obj's underlying member method code with example usage: obj.test_multivariate_normal_covariance_with_sample_chain() without return types