code: def test_tf_while(self):
      fake_kernel = test_fixtures.TestTransitionKernel()
      fake_reducer = test_fixtures.TestReducer()
      reducer_kernel = with_reductions.WithReductions(
          inner_kernel=fake_kernel,
          reducer=fake_reducer,
      )
  
      initial_state = 0.0
      initial_kernel_results = reducer_kernel.bootstrap_results(
          initial_state
      )
  
      def _loop_body(i, curr_state, pkr):
          new_state, kernel_results = reducer_kernel.one_step(
              curr_state, pkr
          )
          return (i + 1, new_state, kernel_results)
  
      _, new_sample, kernel_results = tf.while_loop(
          lambda i, _, __: i < 6,
          _loop_body,
          (0.0, initial_state, initial_kernel_results),
      )
  
      new_sample, kernel_results = self.evaluate(
          [new_sample, kernel_results]
      )
      self.assertEqual(6, kernel_results.reduction_results)
      self.assertEqual(6, new_sample)
      self.assertEqual(6, kernel_results.inner_results.counter_1)
      self.assertEqual(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 4 for calling the WithReductionsTest obj's underlying member method code with example usage: obj.test_tf_while() and returns: unknown,  new_state,  kernel_results