tensorflow_probability/python/distributions/von_mises_fisher.py
def _maybe_assert_valid_sample(self, samples):
    """Check counts for proper shape, values, then return tensor version."""
    if not self.validate_args:
      return samples
    with tf.control_dependencies([
        assert_util.assert_near(
            1.,
            tf.linalg.norm(tensor=samples, axis=-1),
            message='samples must be unit length'),
        assert_util.assert_equal(
            tf.shape(input=samples)[-1:],
            self.event_shape_tensor(),
            message=('samples must have innermost dimension matching that of '
                     '`self.mean_direction`')),
    ]):
      return tf.identity(samples)
def _maybe_assert_valid_sample(self, samples):
    """Check counts for proper shape, values, then return tensor version."""
    if not self.validate_args:
      return samples
    with tf.control_dependencies([
        assert_util.assert_near(
            1.,
            tf.linalg.norm(tensor=samples, axis=-1),
            message='samples must be unit length'),
        assert_util.assert_equal(
            tf.shape(input=samples)[-1:],
            self.event_shape_tensor(),
            message=('samples must have innermost dimension matching that of '
                     '`self.mean_direction`')),
    ]):
      return tf.identity(samples)
Check counts for proper shape, values, then return tensor version.