def _verifyPdfWithNumpy(self, vmf, atol=<NUM_LIT>):
dim = tf.compat.dimension_value(vmf.event_shape[-<NUM_LIT:1>])<EOL>nsamples = <NUM_LIT:10><EOL>sample_shape = [nsamples] + tensorshape_util.as_list(<EOL>vmf.batch_shape) + [dim]<EOL>uniforms = np.random.randn(*sample_shape)<EOL>uniforms /= np.linalg.norm(uniforms, axis=-<NUM_LIT:1>, keepdims=True)<EOL>uniforms = uniforms.astype(dtype_util.as_numpy_dtype(vmf.dtype))<EOL>vmf_samples = vmf.sample(<EOL>sample_shape=[nsamples], seed=tfp_test_util.test_seed())<EOL>samples = tf.concat([uniforms, vmf_samples], axis=<NUM_LIT:0>)<EOL>samples = tf.debugging.check_numerics(samples, '<STR_LIT>')<EOL>samples = self.evaluate(samples)<EOL>log_prob = vmf.log_prob(samples)<EOL>log_prob = tf.debugging.check_numerics(log_prob, '<STR_LIT>')<EOL>try:<EOL><INDENT>from scipy.special import gammaln  <EOL>from scipy.special import ive  <EOL><DEDENT>except ImportError:<EOL><INDENT>tf.compat.v1.logging.warn('<STR_LIT>')<EOL>return<EOL><DEDENT>conc = self.evaluate(vmf.concentration)<EOL>mean_dir = self.evaluate(vmf.mean_direction)<EOL>log_true_sphere_surface_area = (<EOL>np.log(<NUM_LIT:2>) + (dim / <NUM_LIT:2>) * np.log(np.pi) - gammaln(dim / <NUM_LIT:2>))<EOL>expected = (<EOL>conc * np.sum(samples * mean_dir, axis=-<NUM_LIT:1>) +<EOL>np.where(conc > <NUM_LIT:0>,<EOL>(dim / <NUM_LIT:2> - <NUM_LIT:1>) * np.log(conc) -<EOL>(dim / <NUM_LIT:2>) * np.log(<NUM_LIT:2> * np.pi) -<EOL>np.log(ive(dim / <NUM_LIT:2> - <NUM_LIT:1>, conc)) -<EOL>np.abs(conc),<EOL>-log_true_sphere_surface_area))<EOL>self.assertAllClose(expected, self.evaluate(log_prob),<EOL>atol=atol)<EOL>
Verifies log_prob evaluations with numpy/scipy.

        Both uniform random points and sampled points are evaluated.

        Args:
          vmf: A `tfp.distributions.VonMisesFisher` instance.
          atol: Absolute difference tolerable.