File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -742,13 +742,15 @@ def test_logsumexp(self):
742
742
assert np .allclose (LogLikelihoods .logsumexp (log_lls ), np .log (ll_sum ))
743
743
744
744
def test_zeros_logsumexp (self ):
745
- lls = np .log (np .concatenate ([np .zeros (100 ), np .random .rand (1000 )]))
746
- assert np .allclose (LogLikelihoods .logsumexp (lls ), self .naive_logsumexp (lls ))
745
+ with np .errstate (divide = "ignore" ):
746
+ lls = np .log (np .concatenate ([np .zeros (100 ), np .random .rand (1000 )]))
747
+ assert np .allclose (LogLikelihoods .logsumexp (lls ), self .naive_logsumexp (lls ))
747
748
748
749
def test_logsumexp_underflow (self ):
749
750
# underflow in the naive case, but not in the LogLikelihoods implementation
750
751
lls = np .array ([- 1000 , - 1001 ])
751
- assert self .naive_logsumexp (lls ) == - np .inf
752
+ with np .errstate (divide = "ignore" ):
753
+ assert self .naive_logsumexp (lls ) == - np .inf
752
754
assert LogLikelihoods .logsumexp (lls ) != - np .inf
753
755
754
756
def test_log_tri_functions (self ):
You can’t perform that action at this time.
0 commit comments