code: def testVonMisesCdfGradientSimple(self):
      # This is a simple finite difference test that also works in the Eager mode.
      loc = self.make_tensor(0.5)
      concentration = self.make_tensor(0.7)
      x = self.make_tensor(0.6)
  
      _, [dcdf_dloc, dcdf_dconcentration, dcdf_dx] = self.evaluate(
          gradient.value_and_gradient(
              lambda l, c, x: von_mises.VonMises(l, c).cdf(x),
              [loc, concentration, x],
          )
      )
  
      eps = 1e-3
      dcdf_dloc_diff = self.evaluate(
          (
              von_mises.VonMises(
                  loc + eps, concentration, validate_args=True
              ).cdf(x)
              - von_mises.VonMises(
                  loc - eps, concentration, validate_args=True
              ).cdf(x)
          )
          / (2 * eps)
      )
      dcdf_dconcentration_diff = self.evaluate(
          (
              von_mises.VonMises(
                  loc, concentration + eps, validate_args=True
              ).cdf(x)
              - von_mises.VonMises(
                  loc, concentration - eps, validate_args=True
              ).cdf(x)
          )
          / (2 * eps)
      )
      dcdf_dx_diff = self.evaluate(
          (
              von_mises.VonMises(
                  loc, concentration, validate_args=True
              ).cdf(x + eps)
              - von_mises.VonMises(
                  loc, concentration, validate_args=True
              ).cdf(x - eps)
          )
          / (2 * eps)
      )
  
      self.assertAlmostEqual(dcdf_dloc, dcdf_dloc_diff, places=4)
      self.assertAlmostEqual(
          dcdf_dconcentration, dcdf_dconcentration_diff, places=4
      )
      self.assertAlmostEqual(dcdf_dx, dcdf_dx_diff, places=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 11 for calling the _VonMisesTest obj's underlying member method code with example usage: obj.testVonMisesCdfGradientSimple() without return types