Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha committed Nov 13, 2019
1 parent ff623a0 commit acae858
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions torch_struct/semirings/fast_semirings.py
Expand Up @@ -16,6 +16,10 @@ class FastLogSemiring(_BaseLog):
Gradients give marginals.
"""
@staticmethod
def sum(xs, dim=-1):
return torch.logsumexp(xs, dim=dim)


@staticmethod
def matmul(a, b, dims=1):
Expand Down

0 comments on commit acae858

Please sign in to comment.