vt::linalg::inv#
-
template<typename T>
Tensor<T, 2> vt::linalg::inv(Tensor<T, 2> &tensor, cusolverDnHandle_t handle = cuda::cusolver.get_handle())# Compute the inverse of a 2D tensor. This method is based on CuSolver LU factorization and solve. Notice that the input tensor is copied to avoid overwriting.
- Template Parameters:
T – Data type of the tensor.
- Parameters:
tensor – The tensor object to be inversed.
handle – The CuSolver handle. The default is the global CuSolver handle.
- Returns:
Tensor: The inverse tensor object.
-
template<typename T, size_t N>
Tensor<T, N> vt::linalg::inv(Tensor<T, N> &tensor, cublasHandle_t handle = cuda::cublas.get_handle())# Compute the inverse of a N-D tensor. This method is based on CuBLAS LU factorization and solve. Notice that the input tensor is copied to avoid overwriting.
- Template Parameters:
T – Data type of the tensor.
N – Number of dimensions of the tensor.
- Parameters:
tensor – The tensor object to be inversed.
handle – The CuBLAS handle. The default is the global CuBLAS handle.
- Returns:
Tensor<T, N>: The inverse tensor object.