Skip to content

Commit

Permalink
Blacked
Browse files Browse the repository at this point in the history
  • Loading branch information
lezcano committed May 20, 2021
1 parent b235311 commit 991b2d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/eigenvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
problem to the Sphere
"""
import torch

try:
from torch.linalg import eigvalsh
except ImportError:
Expand All @@ -12,6 +13,7 @@
def eigvalsh(X):
return symeig(X, eigenvectors=False).eigenvalues


from torch import nn
import geotorch

Expand Down
2 changes: 2 additions & 0 deletions geotorch/lowrank.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import torch
from functools import partial

try:
from torch.linalg import svd

svd = partial(svd, full_matrices=False)
except ImportError:
from torch import svd
Expand Down
1 change: 1 addition & 0 deletions geotorch/so.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import math
import torch
from torch import nn

try:
from torch.linalg import qr
except ImportError:
Expand Down
3 changes: 3 additions & 0 deletions geotorch/symmetric.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import torch
from torch import nn
from functools import partial

try:
from torch.linalg import eigh
from torch.linalg import eigvalsh
except ImportError:
from torch import symeig

eigh = partial(symeig, eigenvectors=True)

def eigvalsh(X):
return symeig(X, eigenvectors=False).eigenvalues


from .product import ProductManifold
from .stiefel import Stiefel
from .reals import Rn
Expand Down

0 comments on commit 991b2d4

Please sign in to comment.