code: def test_reducer_warm_restart(self):
      fake_kernel = test_fixtures.TestTransitionKernel()
      fake_reducer = test_fixtures.NaiveMeanReducer()
      seed1, seed2 = samplers.split_seed(
          test_util.test_seed(sampler_type="stateless")
      )
      result = sample.sample_chain(
          num_results=5,
          current_state=0.0,
          kernel=fake_kernel,
          reducer=fake_reducer,
          seed=seed1,
      )
      last_sample, red_res, kernel_results = self.evaluate(
          [
              result.final_state,
              result.reduction_results,
              result.final_kernel_results,
          ]
      )
      self.assertEqual(3, red_res)
      self.assertEqual(5, last_sample)
      self.assertEqual(5, kernel_results.counter_1)
      self.assertEqual(10, kernel_results.counter_2)
  
      # Warm-restart the underlying kernel and the reduction using the provided
      # restart package
      result_2 = sample.sample_chain(
          num_results=5, seed=seed2, **result.resume_kwargs
      )
      (
          last_sample_2,
          reduction_result_2,
          kernel_results_2,
      ) = self.evaluate(
          [
              result_2.final_state,
              result_2.reduction_results,
              result_2.final_kernel_results,
          ]
      )
      self.assertEqual(5.5, reduction_result_2)
      self.assertEqual(10, last_sample_2)
      self.assertEqual(10, kernel_results_2.counter_1)
      self.assertEqual(20, kernel_results_2.counter_2)
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/sample_test.py
imports: from tensorflow_probability.python.experimental.mcmc import sample
  from tensorflow_probability.python.experimental.mcmc.internal import test_fixtures
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 2 for calling the RunTest obj's underlying member method code with example usage: obj.test_reducer_warm_restart() without return types