code: def VerifySampleMean(self, mean_dirs, concentration, batch_shape):
      pspherical = power_spherical.PowerSpherical(
          mean_direction=mean_dirs,
          concentration=concentration,
          validate_args=True,
          allow_nan_stats=False,
      )
      self.assertEqual(
          [mean_dirs.shape[-1]],
          tensorshape_util.as_list(pspherical.event_shape),
      )
      self.assertEqual(
          batch_shape, tensorshape_util.as_list(pspherical.batch_shape)
      )
      nsamples = int(5e4)
      samples = pspherical.sample(nsamples, seed=test_util.test_seed())
      self.assertEqual(
          [nsamples] + batch_shape + [mean_dirs.shape[-1]],
          tensorshape_util.as_list(samples.shape),
      )
      sample_mean = self.evaluate(samples).mean(axis=0)
      sample_dir = sample_mean / np.linalg.norm(
          sample_mean, axis=-1, keepdims=True
      )
      # Assert that positive-concentration distributions have samples with
      # the expected mean direction.
      inner_product = self.evaluate(
          tf.reduce_sum(sample_dir * pspherical.mean_direction, axis=-1)
      )
      # Inner products should be roughly ascending by concentration.
      self.assertAllClose(
          np.round(np.sort(inner_product, axis=0), decimals=3),
          np.round(inner_product, decimals=3),
          atol=0.007,
      )
      means = self.evaluate(pspherical.mean())
      # Mean vector for 0-concentration is precisely (0, 0).
      self.assertAllEqual(np.zeros_like(means[0]), means[0])
      mean_lengths = np.linalg.norm(means, axis=-1)
      # Length of the mean vector is strictly ascending with concentration.
      self.assertAllEqual(mean_lengths, np.sort(mean_lengths, axis=0))
      self.assertAllClose(
          np.linalg.norm(sample_mean, axis=-1), mean_lengths, atol=0.03
      )
  
imports: import numpy
  from scipy import special
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import power_spherical
  from tensorflow_probability.python.distributions import spherical_uniform
  from tensorflow_probability.python.distributions import von_mises_fisher
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 2 for calling the _PowerSphericalTest obj's underlying member method code with example usage: obj.VerifySampleMean(mean_dirs, concentration, batch_shape) without return types