Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

torch.eig is deprecated for a long time and is being removed #4

Closed
kit1980 opened this issue Aug 26, 2022 · 1 comment
Closed

torch.eig is deprecated for a long time and is being removed #4

kit1980 opened this issue Aug 26, 2022 · 1 comment

Comments

@kit1980
Copy link

kit1980 commented Aug 26, 2022

PyTorch's torch.eig was deprecated since version 1.9 and is being removed by pytorch/pytorch#70982. Please use the torch.linalg.eig function instead if you want your code to continue to work with the latest PyTorch.

Affected file:

L = torch.eig(ATA).eigenvalues[:,0].max() + mu/2.

@lezcano
Copy link

lezcano commented Aug 31, 2022

Interestingly enough, you can save the ATA multiplication there, and simply write that as

L = torch.svdvals(A).max() ** 2 + mu/2

. For the why, see https://en.wikipedia.org/wiki/Singular_value_decomposition#Relation_to_eigenvalue_decomposition
This is a much more stable and efficient way to compute this quantity.

@bamos bamos closed this as completed in 81b67f1 Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants