code: def test_independent_chain_ndims(self):
      running_rhat = (
          sample_stats.RunningPotentialScaleReduction.from_shape(
              shape=(5, 3), independent_chain_ndims=2
          )
      )
      x = np.arange(30, dtype=np.float32).reshape((2, 5, 3))
      running_rhat = consume(running_rhat, x)
      rhat = running_rhat.potential_scale_reduction()
      true_rhat = diagnostic.potential_scale_reduction(
          chains_states=x, independent_chain_ndims=2
      )
      true_rhat, rhat = self.evaluate([true_rhat, rhat])
      self.assertAllClose(true_rhat, rhat, rtol=1e-6)
  
imports: from absl.testing import parameterized
  import numpy
  import scipy.stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.stats import sample_stats
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import diagnostic
label_desc: Use image node_id 4 for calling the RunningPotentialScaleReductionTest obj's underlying member method code with example usage: obj.test_independent_chain_ndims() without return types