code: def cholesky(a):
      """Cholesky decomposition.
  
      Decompose a given two-dimensional square matrix into ``L * L.H``,
      where ``L`` is a lower-triangular matrix and ``.H`` is a conjugate
      transpose operator.
  
      Args:
          a (cupy.ndarray): Hermitian (symmetric if all elements are real),
              positive-definite input matrix with dimension ``(..., M, M)``.
  
      Returns:
          cupy.ndarray: The lower-triangular matrix of shape ``(..., M, M)``.
  
      .. warning::
          This function calls one or more cuSOLVER routine(s) which may yield
          invalid results if input conditions are not met.
          To detect these invalid results, you can set the `linalg`
          configuration to a value that is not `ignore` in
          :func:`cupyx.errstate` or :func:`cupyx.seterr`.
  
      .. seealso:: :func:`numpy.linalg.cholesky`
      """
      from cupy_backends.cuda.libs import cublas
      from cupy_backends.cuda.libs import cusolver
  
      _util._assert_cupy_array(a)
      _util._assert_stacked_2d(a)
      _util._assert_stacked_square(a)
  
      if a.ndim > 2:
          return _potrf_batched(a)
  
      dtype, out_dtype = _util.linalg_common_type(a)
      if a.size == 0:
          return cupy.empty(a.shape, out_dtype)
  
      x = a.astype(dtype, order="C", copy=True)
      n = len(a)
      handle = device.get_cusolver_handle()
      dev_info = cupy.empty(1, dtype=numpy.int32)
  
      if dtype == "f":
          potrf = cusolver.spotrf
          potrf_bufferSize = cusolver.spotrf_bufferSize
      elif dtype == "d":
          potrf = cusolver.dpotrf
          potrf_bufferSize = cusolver.dpotrf_bufferSize
      elif dtype == "F":
          potrf = cusolver.cpotrf
          potrf_bufferSize = cusolver.cpotrf_bufferSize
      else:  # dtype == 'D':
          potrf = cusolver.zpotrf
          potrf_bufferSize = cusolver.zpotrf_bufferSize
  
      buffersize = potrf_bufferSize(
          handle, cublas.CUBLAS_FILL_MODE_UPPER, n, x.data.ptr, n
      )
      workspace = cupy.empty(buffersize, dtype=dtype)
      potrf(
          handle,
          cublas.CUBLAS_FILL_MODE_UPPER,
          n,
          x.data.ptr,
          n,
          workspace.data.ptr,
          buffersize,
          dev_info.data.ptr,
      )
      cupy.linalg._util._check_cusolver_dev_info_if_synchronization_allowed(
          potrf, dev_info
      )
  
      _util._tril(x, k=0)
      return x.astype(out_dtype, copy=False)
  
file_path: cupy/cupy/linalg/_decomposition.py
imports: import numpy
  import cupy
  from cupy_backends.cuda.api import runtime
  from cupy._core import internal
  from cupy.cuda import device
  from cupy.linalg import _util
label_desc: Use image node_id 3 for calling a global function with example usage: cholesky(a) and returns: x, _potrf_batched, cupy