code: def testTwoStateParts(self):
      dtype = np.float32
      num_results, tolerance = _get_mode_dependent_settings()
  
      true_loc1 = 1.0
      true_scale1 = 1.0
      true_loc2 = -1.0
      true_scale2 = 2.0
      target = jds.JointDistributionSequential(
          [
              normal.Normal(true_loc1, true_scale1),
              normal.Normal(true_loc2, true_scale2),
          ]
      )
  
      num_chains = 16
  
      init_state = [
          np.ones([num_chains], dtype=dtype),
          np.ones([num_chains], dtype=dtype),
      ]
  
      target_fn = tf.function(
          lambda *states: target.log_prob(states), autograph=False
      )
      [states1, states2] = sample.sample_chain(
          num_results=num_results,
          current_state=init_state,
          kernel=slice_sampler_kernel.SliceSampler(
              target_log_prob_fn=target_fn,
              step_size=1.0,
              max_doublings=5,
          ),
          num_burnin_steps=100,
          trace_fn=None,
          seed=test_util.test_seed_stream(),
      )
  
      states1 = tf.reshape(states1, [-1])
      states2 = tf.reshape(states2, [-1])
      sample_mean1 = tf.reduce_mean(states1, axis=0)
      sample_stddev1 = sample_stats.stddev(states1)
      sample_mean2 = tf.reduce_mean(states2, axis=0)
      sample_stddev2 = sample_stats.stddev(states2)
  
      self.assertAllClose(
          true_loc1, sample_mean1, atol=tolerance, rtol=tolerance
      )
      self.assertAllClose(
          true_scale1, sample_stddev1, atol=tolerance, rtol=tolerance
      )
      self.assertAllClose(
          true_loc2, sample_mean2, atol=tolerance, rtol=tolerance
      )
      self.assertAllClose(
          true_scale2, sample_stddev2, atol=tolerance, rtol=tolerance
      )
  
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 4 for calling the SliceSamplerTest obj's underlying member method code with example usage: obj.testTwoStateParts() without return types