svd

ivy.svd(x, f=None)[source]

Singular Value Decomposition. When x is a 2D array, it is factorized as u @ numpy.diag(s) @ vh = (u * s) @ vh, where u and vh are 2D unitary arrays and s is a 1D array of a’s singular values. When x is higher-dimensional, SVD is applied in batched mode.

Parameters
  • x (array) – Input array with number of dimensions >= 2.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns

u -> { (…, M, M), (…, M, K) } array

Unitary array(s). The first (number of dims - 2) dimensions have the same size as those of the input a. The size of the last two dimensions depends on the value of full_matrices.

s -> (…, K) array

Vector(s) with the singular values, within each vector sorted in descending ord. The first (number of dims - 2) dimensions have the same size as those of the input a.

vh -> { (…, N, N), (…, K, N) } array

Unitary array(s). The first (number of dims - 2) dimensions have the same size as those of the input a. The size of the last two dimensions depends on the value of full_matrices.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty