code: def testVonMisesCdfGradient(self):
      # The CDF is implemented manually, with custom gradients.
      # This test checks that the gradients are correct.
      # The gradient checker only works in graph mode and with static shapes.
      if tf.executing_eagerly() or not self.use_static_shape:
          return
  
      n = 10
      locs = tf.cast(tf.constant([1.0] * n), self.dtype)
      concentrations = tf.cast(
          tf.constant(np.logspace(-3, 3, n)), self.dtype
      )
      dist = von_mises.VonMises(locs, concentrations)
      x = tf.constant(
          self.evaluate(dist.sample(seed=test_util.test_seed()))
      )
      cdf = dist.cdf(x)
  
      self.assertLess(
          tf1.test.compute_gradient_error(x, x.shape, cdf, cdf.shape),
          1e-4,
      )
      self.assertLess(
          tf1.test.compute_gradient_error(
              locs, locs.shape, cdf, cdf.shape
          ),
          1e-4,
      )
      self.assertLess(
          tf1.test.compute_gradient_error(
              concentrations, concentrations.shape, cdf, cdf.shape
          ),
          1e-4,
      )
  
imports: import numpy
  from scipy import special
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import von_mises
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 10 for calling the _VonMisesTest obj's underlying member method code with example usage: obj.testVonMisesCdfGradient() without return types