code: def _nc2_cdf_bwd(aux, g):
      """Reverse mode implementation for `_nc2_cdf_abramowitz_and_stegun`."""
      # The gradients for the `noncentrality` parameter can be derived by
      # considering the infinite scale mixture of central Chi2s representation of
      # the noncentral Chi2 and noticing that after differentiating wrt the
      # noncentrality the result simplifies to a difference of two NC2 CDFs.
      nc2_cdf_1, x, df, noncentrality = aux
  
      # Compute gradient for `x`
      grad_x = tf.math.exp(_nc2_log_prob(x, df, noncentrality)) * g
  
      # Compute gradient for `noncentrality`
      nc2_cdf_2 = _nc2_cdf_naive(x, df + 2.0, noncentrality)
  
      grad_nc = 0.5 * (nc2_cdf_2 - nc2_cdf_1) * g
  
      grad_x, grad_nc = generic.fix_gradient_for_broadcasting(
          [x, noncentrality], [grad_x, grad_nc]
      )
  
      return grad_x, None, grad_nc
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import chi2
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import poisson
  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 special_math
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import bessel
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math import root_search
  import tensorflow_probability.python.random
label_desc: Use image node_id 5 for calling a global function with example usage: _nc2_cdf_bwd(aux, g) and returns: grad_x,  None,  grad_nc