code: def _hpsd_solve_jvp(primals, tangents):
      """JVP for hpsd_solve."""
      matrix, rhs, cholesky_matrix = primals
      gmatrix, grhs, gcholesky_matrix = tangents
      del gcholesky_matrix
      output, (cholesky_matrix, _, solve_rhs) = _hpsd_solve_fwd(
          matrix, rhs, cholesky_matrix
      )
      chol_linop = tf.linalg.LinearOperatorLowerTriangular(
          cholesky_matrix
      )
      gmatrix_linop = tf.linalg.LinearOperatorFullMatrix(gmatrix)
      grad = grhs - 0.5 * (
          gmatrix_linop.matmul(solve_rhs)
          + gmatrix_linop.matmul(solve_rhs, adjoint=True)
      )
      chol_inv = chol_linop.solve(
          tf.eye(
              chol_linop.domain_dimension_tensor(),
              dtype=chol_linop.dtype,
          )
      )
      grad = tf.linalg.matmul(
          chol_inv, tf.linalg.matmul(chol_inv, grad), transpose_a=True
      )
      return output, grad
  
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 27 for calling a global function with example usage: _hpsd_solve_jvp(primals, tangents) and returns: output,  grad