code: def testNormalNormalSampleMultipleDatapoints(self):
      if not tf.executing_eagerly():
          self.skipTest(
              "This test runs only in eager mode to reduce test weight."
          )
  
      # Two independent chains, of states of shape [3].
      prior_stddev = self.dtype(np.exp(np.random.rand(2, 3)))
  
      likelihood_stddev = self.dtype(np.exp(np.random.rand(2, 3)))
      # 10 data points.
      data = self.dtype(np.random.randn(10, 2, 3))
  
      # Standard normal prior.
      normal_prior = normal.Normal(self.dtype(0.0), prior_stddev)
  
      def normal_sampler(seed):
          return normal_prior.sample(seed=seed)
  
      # 10 samples at 2 chains.
      def normal_log_likelihood(state):
          return tf.math.reduce_sum(
              normal.Normal(state, likelihood_stddev).log_prob(data),
              axis=[0, -1],
          )
  
      kernel = elliptical_slice_sampler.EllipticalSliceSampler(
          normal_sampler_fn=normal_sampler,
          log_likelihood_fn=normal_log_likelihood,
      )
  
      samples = tf.function(sample.sample_chain)(
          num_results=int(3e4),
          current_state=self.dtype(np.random.randn(2, 3)),
          kernel=kernel,
          num_burnin_steps=int(1e3),
          seed=test_util.test_seed(),
          trace_fn=None,
      )
  
      mean, variance = self.evaluate(tf.nn.moments(samples, axes=[0]))
      posterior_mean, posterior_variance = normal_normal_posterior(
          prior_mean=0.0,
          prior_stddev=prior_stddev,
          likelihood_stddev=likelihood_stddev,
          data=data,
      )
      # Computed exactly from the formula in normal-normal posterior.
      self.assertAllClose(posterior_mean, mean, rtol=2e-2, atol=6e-2)
      self.assertAllClose(posterior_variance, variance, rtol=5e-1)
  
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 2 for calling the _EllipticalSliceSamplerTest obj's underlying member method code with example usage: obj.testNormalNormalSampleMultipleDatapoints() and returns: normal_prior, tf