code: def testSampleAIChainSeedReproducibleWorksCorrectly(
      self, sampler_type
  ):
      independent_chain_ndims = 1
      x = np.random.rand(4, 3, 2)
  
      def proposal_log_prob(x):
          event_dims = ps.range(independent_chain_ndims, ps.rank(x))
          return -0.5 * tf.reduce_sum(
              x**2.0 + np.log(2 * np.pi), axis=event_dims
          )
  
      def target_log_prob(x):
          event_dims = ps.range(independent_chain_ndims, ps.rank(x))
          return self._log_gamma_log_prob(x, event_dims)
  
      seed = test_util.test_seed()
  
      def make_kernel(tlp_fn):
          return hmc.HamiltonianMonteCarlo(
              target_log_prob_fn=tlp_fn,
              step_size=0.5,
              num_leapfrog_steps=2,
          )
  
      ais_kwargs = dict(
          num_steps=200,
          proposal_log_prob_fn=proposal_log_prob,
          target_log_prob_fn=target_log_prob,
          current_state=x,
          make_kernel_fn=make_kernel,
      )
  
      seed = test_util.test_seed(sampler_type=sampler_type)
      _, ais_weights0, _ = sai.sample_annealed_importance_chain(
          seed=_maybe_seed(seed, sampler_type=sampler_type),
          **ais_kwargs,
      )
  
      _, ais_weights1, _ = sai.sample_annealed_importance_chain(
          seed=_maybe_seed(seed, sampler_type=sampler_type),
          **ais_kwargs,
      )
  
      ais_weights0_, ais_weights1_ = self.evaluate(
          [ais_weights0, ais_weights1]
      )
  
      self.assertAllClose(
          ais_weights0_, ais_weights1_, atol=1e-5, rtol=1e-5
      )
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import sample_annealed_importance
  from tensorflow_probability.python.mcmc import transformed_kernel
label_desc: Use image node_id 9 for calling the SampleAnnealedImportanceTest obj's underlying member method code with example usage: obj.testSampleAIChainSeedReproducibleWorksCorrectly(sampler_type) and returns: unknown, self, hmc