code: def hpsd_solvevec(matrix, rhs, cholesky_matrix=None):
      """Computes `matrix^-1 rhs`, where `matrix` is HPSD.
  
      Given `matrix` and `rhs`, computes `matrix^-1 rhs`, where
      `matrix` is a Hermitian positive semi-definite matrix.
  
      Args:
        matrix: Floating-point `Tensor` of shape `[..., N, N]`. Represents
          a Hermitian positive semi-definite matrix.
        rhs: Floating-point `Tensor` of shape `[..., N]`.
        cholesky_matrix: (Optional) Floating-point `Tensor` of shape `[..., N, N]`
          that represents a Cholesky factor of `matrix`.
      Returns:
        hpsd_solvevec: `Tensor` of shape `[..., N]`.
      """
      with tf.name_scope("hpsd_solvevec"):
          dtype = dtype_util.common_dtype(
              [matrix, rhs, cholesky_matrix], tf.float32
          )
          matrix = tf.convert_to_tensor(matrix, dtype=dtype)
          rhs = tf.convert_to_tensor(rhs, dtype=dtype)
          if cholesky_matrix is None:
              cholesky_matrix = tf.linalg.cholesky(matrix)
          else:
              cholesky_matrix = tf.convert_to_tensor(
                  cholesky_matrix, dtype=dtype
              )
          return tf.squeeze(
              _hpsd_solve_custom_gradient(
                  matrix, rhs[..., tf.newaxis], cholesky_matrix
              ),
              axis=-1,
          )
  
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 30 for calling a global function with example usage: hpsd_solvevec(matrix, rhs, cholesky_matrix) and returns: tf