Skip to content

Commit

Permalink
failed example for logcumsumexp (tinygrad#6936)
Browse files Browse the repository at this point in the history
need cummax for numerical stability
  • Loading branch information
chenyuxyz authored Oct 7, 2024
1 parent 102dfe5 commit e4c0743
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,10 @@ def test_logcumsumexp(self):
helper_test_op([()], lambda x: torch.logcumsumexp(x, dim=0), lambda x: x.logcumsumexp(), atol=1e-7, grad_atol=1e-7)
helper_test_op([()], lambda x: torch.logcumsumexp(x, dim=-1), lambda x: x.logcumsumexp(-1), atol=1e-7, grad_atol=1e-7)

@unittest.expectedFailure # TODO: fix numerical instability
def test_logcumsumexp_numerical(self):
helper_test_op(None, lambda x: torch.logcumsumexp(x, dim=0), lambda x: x.logcumsumexp(), atol=1e-7, grad_atol=1e-7, vals=[[0.0, 100.0]])

def test_sinh(self):
helper_test_op([(45,65)], lambda x: x.sinh(), grad_atol=1e-6)
# TODO: backward nan instead of inf
Expand Down

0 comments on commit e4c0743

Please sign in to comment.