Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Fix linalg.cholesky doc consistency issues #51459

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions torch/linalg/__init__.py
Expand Up @@ -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``
Expand Down