code: def test_non_static_thinning_and_burnin(self):
      fake_inner_kernel = test_fixtures.TestTransitionKernel()
      num_burnin_steps = tf.Variable(10, dtype=tf.int32)
      num_steps_between_results = tf.Variable(1, dtype=tf.int32)
      discarder = sample_discarding_kernel.SampleDiscardingKernel(
          fake_inner_kernel,
          num_burnin_steps=num_burnin_steps,
          num_steps_between_results=num_steps_between_results,
      )
  
      def _loop_body(i, curr_state, pkr):
          new_state, kernel_results = discarder.one_step(
              curr_state,
              pkr,
          )
          return (i + 1, new_state, kernel_results)
  
      pkr = discarder.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_burnin_steps.initializer,
              num_steps_between_results.initializer,
          ]
      )
      final_sample, kernel_results = self.evaluate(
          [final_sample, kernel_results]
      )
      self.assertEqual(14, final_sample)
      self.assertEqual(2, kernel_results.call_counter)
      self.assertEqual(14, kernel_results.inner_results.counter_1)
      self.assertEqual(28, kernel_results.inner_results.counter_2)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import covariance_reducer
  from tensorflow_probability.python.experimental.mcmc import sample_discarding_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 10 for calling the SampleDiscardingTest obj's underlying member method code with example usage: obj.test_non_static_thinning_and_burnin() and returns: unknown,  new_state,  kernel_results