Skip to content

svd#

Includes our svd bindings.

Functions:

  • svd

    Computes the singular value decomposition of a matrix on a given location.

svd #

svd(A: NDArray, full_matrices: bool = True, compute_module: str = 'numpy', output_module: str | None = None, use_pinned_memory: bool = True) -> tuple[NDArray, NDArray, NDArray]

Computes the singular value decomposition of a matrix on a given location.

The kwargs compute_uv and hermitian are not supported. They are implicitly set to True and False, respectively.

Parameters:

  • A (NDArray) –

    The matrix.

  • full_matrices (bool, default: True ) –

    Whether to compute the full matrices u and vh (see numpy.linalg.svd).

  • compute_module (str, default: 'numpy' ) –

    The location where to compute the singular value decomposition. Can be either "numpy" or "cupy".

  • output_module (str, default: None ) –

    The location where to store the singular value decomposition. Can be either "numpy" or "cupy". If None, the output location is the same as the input location

  • use_pinned_memory (bool, default: True ) –

    Whether to use pinnend memory if cupy is used. Default is True.

Returns:

  • NDArray

    The left singular vectors.

  • NDArray

    The singular values.

  • NDArray

    The right singular vectors.