[doc] Fix linalg.cholesky doc consistency issues (#51459)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51459
This PR is part of a larger effort to ensure torch.linalg documentation is consistent (see #50287).
Test Plan: Imported from OSS
Reviewed By: mruberry
Differential Revision: D26176131
Pulled By: heitorschueroff
fbshipit-source-id: 2ad88a339e6dff044965e8bf29dd8c852afecb34
diff --git a/torch/linalg/__init__.py b/torch/linalg/__init__.py
index 1839c86..44139c5 100644
--- a/torch/linalg/__init__.py
+++ b/torch/linalg/__init__.py
@@ -21,23 +21,24 @@
where :math:`L` is a lower-triangular matrix and :math:`L^H` is the conjugate transpose of :math:`L`,
which is just a transpose for the case of real-valued input matrices.
-In code it translates to ``input = L @ L.t()` if :attr:`input` is real-valued and
+In code it translates to ``input = L @ L.t()`` if :attr:`input` is real-valued and
``input = L @ L.conj().t()`` if :attr:`input` is complex-valued.
The batch of :math:`L` matrices is returned.
Supports real-valued and complex-valued inputs.
+.. note:: When given inputs on a CUDA device, this function synchronizes that device with the CPU.
+
+.. note:: LAPACK's `potrf` is used for CPU inputs, and MAGMA's `potrf` is used for CUDA inputs.
+
.. note:: If :attr:`input` is not a Hermitian positive-definite matrix, or if it's a batch of matrices
and one or more of them is not a Hermitian positive-definite matrix, then a RuntimeError will be thrown.
If :attr:`input` is a batch of matrices, then the error message will include the batch index
of the first matrix that is not Hermitian positive-definite.
-.. warning:: This function always checks whether :attr:`input` is a Hermitian positive-definite matrix
- using `info` argument to LAPACK/MAGMA call. For CUDA this causes cross-device memory synchronization.
-
Args:
input (Tensor): the input tensor of size :math:`(*, n, n)` consisting of Hermitian positive-definite
- :math:`n \times n` matrices, where `*` is zero or more batch dimensions.
+ :math:`n \times n` matrices, where :math:`*` is zero or more batch dimensions.
Keyword args:
out (Tensor, optional): The output tensor. Ignored if ``None``. Default: ``None``