code: def inv(a):
      """Computes the inverse of a matrix.
  
      This function computes matrix ``a_inv`` from n-dimensional regular matrix
      ``a`` such that ``dot(a, a_inv) == eye(n)``.
  
      Args:
          a (cupy.ndarray): The regular matrix
  
      Returns:
          cupy.ndarray: The inverse of a matrix.
  
      .. 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.inv`
      """
      _util._assert_cupy_array(a)
      _util._assert_stacked_2d(a)
      _util._assert_stacked_square(a)
  
      if a.ndim >= 3:
          return _batched_inv(a)
  
      dtype, out_dtype = _util.linalg_common_type(a)
      if a.size == 0:
          return cupy.empty(a.shape, out_dtype)
  
      order = "F" if a._f_contiguous else "C"
      # prevent 'a' to be overwritten
      a = a.astype(dtype, copy=True, order=order)
      b = cupy.eye(a.shape[0], dtype=dtype, order=order)
      if order == "F":
          cupyx.lapack.gesv(a, b)
      else:
          cupyx.lapack.gesv(a.T, b.T)
      return b.astype(out_dtype, copy=False)
  
file_path: cupy/cupy/linalg/_solve.py
imports: import warnings
  import numpy
  from numpy import linalg
  import cupy
  from cupy._core import internal
  from cupy.cuda import device
  from cupy.linalg import _decomposition
  from cupy.linalg import _util
  import cupyx
label_desc: Use image node_id 5 for calling a global function with example usage: inv(a) and returns: b, _batched_inv, cupy