vt::linalg::svd#

template<typename T>
std::tuple<Tensor<T, 2>, Tensor<T, 1>, Tensor<T, 2>> vt::linalg::svd(Tensor<T, 2> &tensor, bool full_matrices = true, bool compute_uv = true, cusolverDnHandle_t handle = cuda::cusolver.get_handle())#

Singular Value Decomposition.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • tensor – The tensor object to be decomposed.

  • full_matrices – If True, it returns u and v with full dimensions.

  • compute_uv – If False, it only returns singular values.

  • handle – The CuSolver handle. The default is the global CuSolver handle.

Returns:

A tuple of U, S, V, where tensor = U * diag(S) * V. (diag neeeded to be implemented)

template<typename T, size_t N>
std::tuple<Tensor<T, N>, Tensor<T, N - 1>, Tensor<T, N>> vt::linalg::svd(Tensor<T, N> &tensor, bool full_matrices = true, bool compute_uv = true, cusolverDnHandle_t handle = cuda::cusolver.get_handle())#

Batched Singular Value Decomposition.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor – The tensor object to be decomposed.

  • full_matrices – If True, it returns u and v with full dimensions.

  • compute_uv – If False, it only returns singular values.

  • handle – The CuSolver handle. The default is the global CuSolver handle.

Returns:

A tuple of U, S, V, where tensor = U * diag(S) * V. (diag neeeded to be implemented)