code: def _retrying_cholesky_bwd(max_iters, unroll, aux, g):
      """Reverse mode impl for retrying_cholesky."""
      del max_iters, unroll
      _, matrix, _, shift = aux
  
      # Recompute triangular factor so we can take gradients of gradients.
      triangular_factor = tf.linalg.cholesky(
          tf.linalg.set_diag(
              matrix, tf.linalg.diag_part(matrix) + shift
          )
      )
  
      num_rows = ps.shape(triangular_factor)[-1]
      batch_shape = ps.shape(triangular_factor)[:-2]
      t_inverse = tf.linalg.triangular_solve(
          triangular_factor,
          tf.linalg.eye(
              num_rows,
              batch_shape=batch_shape,
              dtype=triangular_factor.dtype,
          ),
      )
      middle = tf.linalg.matmul(triangular_factor, g[0], adjoint_a=True)
      middle = tf.linalg.set_diag(
          middle, 0.5 * tf.linalg.diag_part(middle)
      )
      middle = tf.linalg.band_part(middle, -1, 0)
      grad = tf.linalg.matmul(
          tf.linalg.matmul(t_inverse, middle, adjoint_a=True), t_inverse
      )
      grad = grad + tf.linalg.adjoint(grad)
      # Shift has no gradients.
      return 0.5 * grad, None
  
file_path: probability/tensorflow_probability/python/experimental/distributions/marginal_fns.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 5 for calling a global function with example usage: _retrying_cholesky_bwd(max_iters, unroll, aux, g) and returns: unknown,  None