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

Use torch.linalg for solve and cholesky #623

Merged
merged 2 commits into from
Jun 28, 2022
Merged

Use torch.linalg for solve and cholesky #623

merged 2 commits into from
Jun 28, 2022

Conversation

mpariente
Copy link
Collaborator

Available (at least) from 1.8.0 and deprecated in the nightly builds already.

@mpariente
Copy link
Collaborator Author

For reference.

Solve

.. warning::

    :func:`torch.solve` is deprecated in favor of :func:`torch.linalg.solve`
    and will be removed in a future PyTorch release.
    :func:`torch.linalg.solve` has its arguments reversed and does not return the
    LU factorization of the input. To get the LU factorization see :func:`torch.lu`,
    which may be used with :func:`torch.lu_solve` and :func:`torch.lu_unpack`.

    ``X = torch.solve(B, A).solution`` should be replaced with

    .. code:: python

        X = torch.linalg.solve(A, B)

Cholesky

.. note:: :func:`torch.linalg.cholesky` should be used over ``torch.cholesky`` when possible.
          Note however that :func:`torch.linalg.cholesky` does not yet support the :attr:`upper`
          parameter and instead always returns the lower triangular matrix.

.. warning::

    :func:`torch.cholesky` is deprecated in favor of :func:`torch.linalg.cholesky`
    and will be removed in a future PyTorch release.

    ``L = torch.cholesky(A)`` should be replaced with

    .. code:: python

        L = torch.linalg.cholesky(A)

    ``U = torch.cholesky(A, upper=True)`` should be replaced with

    .. code:: python

        U = torch.linalg.cholesky(A).mH

    This transform will produce equivalent results for all valid (symmetric positive definite) inputs.

@mpariente mpariente merged commit 5b83e45 into master Jun 28, 2022
@mpariente mpariente deleted the fix_tests branch June 28, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant