rctn / sparsecoding

Reference sparse coding implementations for efficient learning and inference.
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

symeig -> eigvalsh #36

Closed alvinzz closed 2 years ago

alvinzz commented 2 years ago

avoids

sparsecoding/inference.py:441: UserWarning: torch.symeig is deprecated in favor of torch.linalg.eigh and will be removed in a future PyTorch release.
The default behavior has changed from using the upper triangular portion of the matrix by default to using the lower triangular portion.
L, _ = torch.symeig(A, upper=upper)
should be replaced with
L = torch.linalg.eigvalsh(A, UPLO='U' if upper else 'L')
and
L, V = torch.symeig(A, eigenvectors=True)
should be replaced with
L, V = torch.linalg.eigh(A, UPLO='U' if upper else 'L') (Triggered internally at  ../aten/src/ATen/native/BatchLinearAlgebra.cpp:2524.)
  lipschitz_constant = torch.symeig(
.......................