Skip to content

Commit

Permalink
fix poincare dist2
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrine committed Nov 14, 2019
1 parent 03a2542 commit 44e3fce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions geoopt/manifolds/poincare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def dist(
) -> torch.Tensor:
return math.dist(x, y, c=self.c, keepdim=keepdim, dim=dim)

def dist2(
self, x: torch.Tensor, y: torch.Tensor, *, keepdim=False, dim=-1
) -> torch.Tensor:
return math.dist(x, y, c=self.c, keepdim=keepdim, dim=dim) ** 2

def egrad2rgrad(self, x: torch.Tensor, u: torch.Tensor, *, dim=-1) -> torch.Tensor:
return math.egrad2rgrad(x, u, c=self.c, dim=dim)

Expand Down

0 comments on commit 44e3fce

Please sign in to comment.