code: def test_non_static_thinning(self):
      fake_inner_kernel = test_fixtures.TestTransitionKernel()
      num_steps_to_skip = tf.Variable(1, dtype=tf.int32)
      thinner = thinning_kernel.ThinningKernel(
          fake_inner_kernel, num_steps_to_skip=num_steps_to_skip
      )
  
      def _loop_body(i, curr_state, pkr):
          new_state, kernel_results = thinner.one_step(
              curr_state,
              pkr,
          )
          return (i + 1, new_state, kernel_results)
  
      pkr = thinner.bootstrap_results(0.0)
      _, final_sample, kernel_results = tf.while_loop(
          lambda i, *_: i < 2,
          _loop_body,
          (0.0, 0.0, pkr),
      )
      self.evaluate([num_steps_to_skip.initializer])
      final_sample, kernel_results = self.evaluate(
          [final_sample, kernel_results]
      )
      self.assertEqual(4, final_sample)
      self.assertEqual(4, kernel_results.counter_1)
      self.assertEqual(8, kernel_results.counter_2)
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/thinning_kernel_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import covariance_reducer
  from tensorflow_probability.python.experimental.mcmc import thinning_kernel
  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 samplers
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 8 for calling the ThinningTest obj's underlying member method code with example usage: obj.test_non_static_thinning() and returns: unknown,  new_state,  kernel_results