Skip to content

Commit

Permalink
Fix _logmatmulexp comment (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzo committed Jun 8, 2022
1 parent 9022252 commit f4b13ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyro/distributions/hmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _linear_integrate(init, trans, shift):

def _logmatmulexp(x, y):
"""
Numerically stable version of ``(x.log() @ y.log()).exp()``.
Numerically stable version of ``(x.exp() @ y.exp()).log()``.
"""
finfo = torch.finfo(x.dtype) # avoid nan due to -inf - -inf
x_shift = x.detach().max(-1, keepdim=True).values.clamp_(min=finfo.min)
Expand Down

0 comments on commit f4b13ec

Please sign in to comment.