code: def test_computes_same_direction_for_unsharded_state(self):
      if not JAX_MODE:
          self.skipTest(
              "Test in TF runs into `merge_call` error: see b/178944108"
          )
  
      def target_log_prob(a, b):
          return normal.Normal(0.0, 1.0).log_prob(
              a
          ) + distribute_lib.psum(
              normal.Normal(
                  distribute_lib.pbroadcast(a, "foo"), 1.0
              ).log_prob(b),
              "foo",
          )
  
      kernel = slice_sampler_kernel.SliceSampler(
          target_log_prob, 1e-1, 5
      )
      sharded_kernel = kernel.experimental_with_shard_axes(
          [None, ["foo"]]
      )
  
      def run(seed):
          state = [tf.convert_to_tensor(0.0), tf.convert_to_tensor(0.0)]
          kr = sharded_kernel.bootstrap_results(state)
          _, kr = sharded_kernel.one_step(state, kr, seed=seed)
          return kr.direction
  
      direction = self.evaluate(
          self.per_replica_to_tensor(
              self.strategy_run(
                  run,
                  args=(samplers.zeros_seed(),),
                  in_axes=None,
                  axis_name="foo",
              ),
              0,
          )
      )
  
      for i in range(distribute_test_lib.NUM_DEVICES):
          self.assertAllClose(direction[0][i], direction[0][0])
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import distribute_test_lib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import random_walk_metropolis
  from tensorflow_probability.python.mcmc import sample
  from tensorflow_probability.python.mcmc import slice_sampler_kernel
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 2 for calling the DistributedRWMTest obj's underlying member method code with example usage: obj.test_computes_same_direction_for_unsharded_state() and returns: unknown, kr