Skip to contents

Supports input of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if A is a batch of matrices then the output has the same batch dimensions. The singular values are returned in descending order.

Usage

linalg_svdvals(A)

Arguments

A

(Tensor): tensor of shape (*, m, n) where * is zero or more batch dimensions.

Value

A real-valued tensor, even when A is complex.

Examples

if (torch_is_installed()) {
A <- torch_randn(5, 3)
S <- linalg_svdvals(A)
S
}
#> torch_tensor
#>  4.1056
#>  1.5721
#>  0.7284
#> [ CPUFloatType{3} ]