code: def testAssertValidSample(self):
      mean_dir = tf.math.l2_normalize(
          [[1.0, 2, 3], [-2, -3, -1]], axis=-1
      )
      concentration = [[0.0], [2.0]]
      pspherical = power_spherical.PowerSpherical(
          mean_direction=mean_dir,
          concentration=concentration,
          validate_args=True,
          allow_nan_stats=False,
      )
  
      with self.assertRaisesOpError("Samples must be unit length."):
          self.evaluate(pspherical.prob([0.5, 0.5, 0.5]))
  
      msg = "must have innermost dimension matching"
      static_shape_assertion = self.assertRaisesRegexp(ValueError, msg)
      dynamic_shape_assertion = self.assertRaisesOpError(msg)
  
      x = [[1.0, 0.0, 0.0, 0.0]]
      with static_shape_assertion:
          self.evaluate(pspherical.log_prob(x))
  
      x_var = tf.Variable(x, shape=tf.TensorShape(None))
      shape_assertion = (
          static_shape_assertion
          if tf.executing_eagerly()
          else dynamic_shape_assertion
      )
      self.evaluate(x_var.initializer)
      with shape_assertion:
          self.evaluate(pspherical.log_prob(x_var))
  
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 24 for calling the _PowerSphericalTest obj's underlying member method code with example usage: obj.testAssertValidSample() without return types