code: def _docs_linalg():
      _docs.set_doc(
          chainerx.dot,
          """dot(a, b)
  Returns a dot product of two arrays.
  
  For arrays with more than one axis, it computes the dot product along the last
  axis of ``a`` and the second-to-last axis of ``b``. This is just a matrix
  product if the both arrays are 2-D. For 1-D arrays, it uses their unique axis
  as an axis to take dot product over.
  
  Args:
      a (~chainerx.ndarray): The left argument.
      b (~chainerx.ndarray): The right argument.
  
  Returns:
      :class:`~chainerx.ndarray`: Output array.
  
  Note:
      This function currently does not support N > 2 dimensional arrays.
  
  Note:
      During backpropagation, this function propagates the gradient of the
      output array to input arrays ``a`` and ``b``.
  
  .. seealso:: :func:`numpy.dot`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.solve,
          """solve(a, b)
  Solves a linear matrix equation, or system of linear scalar equations.
  
  It computes the exact solution of ``x`` in ``ax = b``,
  where ``a`` is a square and full rank matrix,
  ``b`` can be a vector, or a rectangular matrix.
  When ``b`` is matrix, its columns are treated as separate vectors
  representing multiple right-hand sides.
  
  Args:
      a (~chainerx.ndarray): Coefficient matrix.
      b (~chainerx.ndarray): "dependent variable" values.
  
  Returns:
      :class:`~chainerx.ndarray`:
          Solution to the system ``ax = b``.
          Shape is identical to ``b``.
  
  Note:
      The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
      supported yet.)
  
  .. seealso:: :func:`numpy.linalg.solve`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.inv,
          """inv(a)
  Computes the inverse of a matrix.
  
  This function computes matrix ``a_inv`` from square matrix
  ``a`` such that ``dot(a, a_inv) = dot(a_inv, a) = eye(a.shape[0])``.
  
  Args:
      a (~chainerx.ndarray): The matrix to be inverted.
  
  Returns:
      :class:`~chainerx.ndarray`: The inverse of a matrix.
  
  Note:
      The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
      supported yet.)
  
  .. seealso:: :func:`numpy.linalg.inv`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.svd,
          """svd(a, full_matrices=True, compute_uv=True)
  Singular Value Decomposition.
  
  Factorizes the matrix ``a`` into two unitary matrices ``U`` and ``Vt``, and
  a 1-D array ``s`` of singular values such that
  ``a == U * S * Vt``, where ``S`` is a suitably shaped matrix of zeros with
  main diagonal ``s`` and ``*`` represents a dot product.
  
  Args:
      a (~chainerx.ndarray): The input matrix with dimension ``(M, N)``.
      full_matrices (bool): If True, it returns u and v with dimensions
          ``(M, M)`` and ``(N, N)``. Otherwise, the dimensions of u and v
          are respectively ``(M, K)`` and ``(K, N)``, where
          ``K = min(M, N)``.
      compute_uv (bool): If False, only singular values are computed.
  
  Returns:
      tuple of :class:`chainerx.ndarray`:
          A tuple of ``(U, s, Vt)`` such that ``a = U * diag(s) * Vt``.
          When ``compute_uv`` is False only singular values ``s`` are returned.
  
  Note:
      * The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
        supported yet.)
      * The SVD is commonly written as `a = U * diag(s) * V^T`.
        The ``Vt`` returned by this function is `V^T`.
      * During backpropagation, this function requires ``U`` and ``Vt`` computed,
        therefore differentiation does not work for ``compute_uv=False``.
      * Backpropagation is not implemented for ``full_matrices=True``.
  
  .. seealso:: :func:`numpy.linalg.svd`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.pinv,
          """pinv(a, rcond=1e-15)
  Compute the (Moore-Penrose) pseudo-inverse of a matrix.
  
  Calculate the generalized inverse of a matrix using its singular-value
  decomposition (SVD) and including all large singular values.
  
  Args:
      a (~chainerx.ndarray): The input matrix to be pseudo-inverted.
      rcond (float): Cutoff for small singular values.
  
  Returns:
      :class:`~chainerx.ndarray`: The pseudo-inverse of ``a``.
  
  Note:
      The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
      supported yet.)
  
  .. seealso:: :func:`numpy.linalg.pinv`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.qr,
          """qr(a, mode='reduced')
  Compute the qr factorization of a matrix.
  
  Factor the matrix ``a`` as *qr*, where ``q`` is orthonormal and ``r`` is
  upper-triangular.
  
  Args:
      a (~chainerx.ndarray): Matrix to be factored.
      mode (str): The mode of decomposition.
          'reduced' : returns q, r with dimensions (M, K), (K, N) (default)
          'complete' : returns q, r with dimensions (M, M), (M, N)
          'r' : returns r only with dimensions (K, N)
          'raw' : returns h, tau with dimensions (N, M), (K,),
          where ``(M, N)`` is the shape of the input matrix and ``K = min(M, N)``
  
  Returns:
      q (~chainerx.ndarray): A matrix with orthonormal columns.
      r (~chainerx.ndarray): The upper-triangular matrix.
  
  Note:
      * The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
        supported yet.)
      * Backpropagation is not implemented for non-square output matrix ``r``.
      * Backpropagation is not implemented for 'r' or 'raw' modes.
  
  .. seealso:: :func:`numpy.linalg.qr`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.cholesky,
          """cholesky(a)
  Computes the Cholesky decomposition of a matrix.
  
  Returns the Cholesky decomposition, :math:`A = L L^T`,
  for the square matrix ``a``.
  
  Args:
      a (~chainerx.ndarray): Symmetric positive-definite input matrix.
  
  Returns:
      :class:`~chainerx.ndarray`: Output array. Cholesky factor of ``a``.
  
  Note:
      The forward computation does not necessarily check if the input matrix is
      symmetric (e.g. the native backend relying on LAPACK does not). However,
      both the forward and the backward computations assume that it is and their
      results are unspecified otherwise. The computed gradient is always a
      symmetric matrix. More specifically, the gradient is computed as if the
      function is restricted to a Riemannian submanifold of
      :math:`R^{n \\times n}` consisting just of positive-definite symmetric
      matrices and is faithful to the mathematical definition of the Cholesky
      decomposition.
  
  Note:
      * GPU implementation of the Cholesky decomposition routine is based on
        cuSOLVER library. Older versions (<10.1) of it might not raise an error
        for some non positive-definite matrices.
      * The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
        supported yet.)
  
  .. seealso:: :func:`numpy.linalg.cholesky`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.eigh,
          """eigh(a, UPLO='L')
  Compute the eigenvalues and eigenvectors of a real symmetric matrix.
  
  Args:
      a (~chainerx.ndarray): Real symmetric matrix whose eigenvalues
          and eigenvectors are to be computed.
      UPLO (str): Specifies whether the calculation is done with the lower
          triangular part of a ('L', default) or the upper triangular part ('U').
  
  Returns:
      tuple of :class:`~chainerx.ndarray`:
          Returns a tuple ``(w, v)``. ``w`` contains eigenvalues and
          ``v`` contains eigenvectors. ``v[:, i]`` is an eigenvector
          corresponding to an eigenvalue ``w[i]``.
  
  Note:
      Although ``UPLO`` can be specified to ignore either the strictly lower or
      upper part of the input matrix, the backward computation assumes that the
      inputs is symmetric and the computed gradient is always a symmetric matrix
      with respect to ``UPLO``. More specifically, the gradient is computed as if
      the function is restricted to a Riemannian submanifold of
      :math:`R^{n \\times n}` consisting just of symmetric matrices and is
      faithful to the mathematical definition of the eigenvalue decomposition of
      symmetric matrices.
  
  Note:
      The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
      supported yet.)
  
  .. seealso:: :func:`numpy.linalg.eigh`
  """,
      )
  
      _docs.set_doc(
          chainerx.linalg.eigvalsh,
          """eigvalsh(a, UPLO='L')
  Compute the eigenvalues of a real symmetric matrix.
  
  Main difference from eigh: the eigenvectors are not computed.
  
  Args:
      a (~chainerx.ndarray): Real symmetric matrix whose eigenvalues
          and eigenvectors are to be computed.
      UPLO (str): Specifies whether the calculation is done with the lower
          triangular part of a (‘L’, default) or the upper triangular part (‘U’).
          (optional).
  
  Returns:
      :class:`~chainerx.ndarray`: Returns eigenvalues as a vector.
  
  Note:
      * The ``dtype`` must be ``float32`` or ``float64`` (``float16`` is not
        supported yet.)
      * Backpropagation requires eigenvectors and, therefore, is not implemented
        for this function. ``linalg.eigh`` should be used instead.
  
  .. seealso:: :func:`numpy.linalg.eigvalsh`
  """,
      )
  
file_path: chainer/chainerx/_docs/routines.py
imports: import chainerx
  from chainerx import _docs
label_desc: Use image node_id 5 for calling a global function with example usage: _docs_linalg() without return types