code: def is_pos_def(X, tol=0.0, fast_mode=False):
      """Check if all matrices are positive definite (PD).
  
      Check if all matrices are positive definite, fast verification is done
      with Cholesky decomposition, while full check compute all eigenvalues
      to verify that they are positive.
  
      Parameters
      ----------
      X : ndarray, shape (..., n, n)
          The set of square matrices, at least 2D ndarray.
      tol : float, default 0.0
          Threshold below which eigen values are considered zero.
      fast_mode : boolean, default=False
          Use Cholesky decomposition to avoid computing all eigenvalues.
  
      Returns
      -------
      ret : boolean
          True if all matrices are positive definite.
      """
      if fast_mode:
          try:
              np.linalg.cholesky(X)
              return True
          except np.linalg.LinAlgError:
              return False
      else:
          return is_square(X) and np.all(_get_eigenvals(X) > tol)
  
file_path: pyRiemann/pyriemann/utils/test.py
imports: import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: is_pos_def(X, tol, fast_mode) and returns: unknown, True, False