code: def _hpsd_quadratic_form_solve_bwd(aux, g):
      """Reverse mode impl for hpsd_quadratic_form_solve."""
      cholesky_matrix, rhs, solve_rhs = aux
      chol_linop = tf.linalg.LinearOperatorLowerTriangular(
          cholesky_matrix
      )
      full_solve = chol_linop.solve(solve_rhs, adjoint=True)
      matrix_grad = -tf.linalg.matmul(
          full_solve, tf.linalg.matmul(g, full_solve, transpose_b=True)
      )
      rhs_grad = tf.linalg.matmul(2.0 * full_solve, g)
  
      # Given that Matrix has shape [N, N] and RHS has shape [N, M], we
      # need to add extra ones to make the shapes agree.
  
      matrix_grad, rhs_grad = generic.fix_gradient_for_broadcasting(
          [cholesky_matrix[..., tf.newaxis], rhs[..., tf.newaxis, :]],
          [matrix_grad[..., tf.newaxis], rhs_grad[..., tf.newaxis, :]],
      )
      return (
          tf.squeeze(matrix_grad, axis=-1),
          tf.squeeze(rhs_grad, axis=-2),
          None,
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  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 prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 32 for calling a global function with example usage: _hpsd_quadratic_form_solve_bwd(aux, g) and returns: tf,  tf,  None