code: def _von_mises_sample_bwd(_, aux, dy):
      """The gradient of the von Mises samples w.r.t. concentration."""
      concentration, samples = aux
      broadcast_concentration = tf.broadcast_to(
          concentration, ps.shape(samples)
      )
      _, dcdf_dconcentration = value_and_gradient(
          lambda conc: von_mises_cdf(samples, conc),
          broadcast_concentration,
      )
      inv_prob = tf.exp(-broadcast_concentration * cosxm1(samples)) * (
          (2.0 * np.pi) * tf.math.bessel_i0e(broadcast_concentration)
      )
      # Compute the implicit reparameterization gradient [2],
      # dz/dconc = -(dF(z; conc) / dconc) / p(z; conc)
      ret = dy * (-dcdf_dconcentration * inv_prob)
      # Sum over the sample dimensions. Assume that they are always the first
      # ones.
      num_sample_dimensions = tf.rank(
          broadcast_concentration
      ) - tf.rank(concentration)
  
      # None gradients for seed
      return (
          tf.reduce_sum(ret, axis=tf.range(num_sample_dimensions)),
          None,
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
label_desc: Use image node_id 8 for calling a global function with example usage: _von_mises_sample_bwd(_, aux, dy) and returns: tf,  None