code: def hpsd_logdet(matrix, cholesky_matrix=None):
      """Computes `log|det(matrix)|`, where `matrix` is a HPSD matrix.
  
      Given `matrix` computes `log|det(matrix)|`, where `matrix` is Hermitian
      positive Semi-definite matrix.
  
      Args:
        matrix: Floating-point `Tensor` of shape `[..., N, N]`. Represents
          a Hermitian positive semi-definite matrix.
        cholesky_matrix: (Optional) Floating-point `Tensor` of shape `[..., N, N]`
          that represents a Cholesky factor of `matrix`.
      Returns:
        hpsd_logdet: Scalar `Tensor`, retaining the batch shape of `matrix`.
      """
      with tf.name_scope("hpsd_logdet"):
          dtype = dtype_util.common_dtype(
              [matrix, cholesky_matrix], tf.float32
          )
          matrix = tf.convert_to_tensor(matrix, dtype=dtype)
          if cholesky_matrix is not None:
              cholesky_matrix = tf.convert_to_tensor(
                  cholesky_matrix, dtype=dtype
              )
          return _hpsd_logdet_custom_gradient(matrix, cholesky_matrix)
  
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 24 for calling a global function with example usage: hpsd_logdet(matrix, cholesky_matrix) and returns: _hpsd_logdet_custom_gradient