code: def testSampleChainSeedReproducible(self):
      normal_prior = normal.Normal(5 * [[0.0, 0.0]], 1.0)
  
      def normal_sampler(seed):
          return normal_prior.sample(seed=seed)
  
      def normal_log_likelihood(state):
          return tf.math.reduce_sum(
              normal.Normal(state, 2.0).log_prob(0.0), axis=-1
          )
  
      num_results = 10
      seed = test_util.test_seed()
  
      current_state = np.float32(np.random.rand(5, 2))
      samples0 = tf.function(
          lambda: sample.sample_chain(  # pylint: disable=g-long-lambda
              num_results=2 * num_results,
              num_steps_between_results=0,
              current_state=current_state,
              kernel=elliptical_slice_sampler.EllipticalSliceSampler(
                  normal_sampler_fn=normal_sampler,
                  log_likelihood_fn=normal_log_likelihood,
              ),
              num_burnin_steps=150,
              trace_fn=None,
              seed=seed,
          )
      )()
  
      samples1 = tf.function(
          lambda: sample.sample_chain(  # pylint: disable=g-long-lambda
              num_results=num_results,
              num_steps_between_results=1,
              current_state=current_state,
              kernel=elliptical_slice_sampler.EllipticalSliceSampler(
                  normal_sampler_fn=normal_sampler,
                  log_likelihood_fn=normal_log_likelihood,
              ),
              trace_fn=None,
              num_burnin_steps=150,
              seed=seed,
          )
      )()
      samples0_, samples1_ = self.evaluate([samples0, samples1])
  
      self.assertAllClose(
          samples0_[::2], samples1_, atol=1e-5, rtol=1e-5
      )
  
file_path: probability/tensorflow_probability/python/experimental/mcmc/elliptical_slice_sampler_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.experimental.mcmc import elliptical_slice_sampler
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import sample
label_desc: Use image node_id 1 for calling the _EllipticalSliceSamplerTest obj's underlying member method code with example usage: obj.testSampleChainSeedReproducible() and returns: normal_prior, tf