Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrine committed May 16, 2019
1 parent d191594 commit f10f08d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geoopt/samplers/rsgld.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def step(self, closure):
n = torch.randn_like(p).mul_(math.sqrt(epsilon))
r = egrad2rgrad(p, 0.5 * epsilon * p.grad + n)
# use copy only for user facing point
p.copy_(retr(p, r, 1.0))
copy_or_set(p, retr(p, r, 1.0))
p.grad.zero_()

if not self.burnin:
Expand Down
3 changes: 2 additions & 1 deletion geoopt/tensor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch.nn
from .manifolds import Euclidean
from .docutils import insert_docs
from .utils import copy_or_set

__all__ = ["ManifoldTensor", "ManifoldParameter"]

Expand Down Expand Up @@ -37,7 +38,7 @@ def proj_(self):
tensor
same instance
"""
return self.copy_(self.manifold.projx(self))
return copy_or_set(self, self.manifold.projx(self))

@insert_docs(Euclidean.retr.__doc__, r"\s+x : .+\n.+", "")
def retr(self, u, t=1.0, order=None):
Expand Down

0 comments on commit f10f08d

Please sign in to comment.