Skip to content

Commit

Permalink
Merge pull request #444 from rsokl/fix-test
Browse files Browse the repository at this point in the history
Loosen test requirements
  • Loading branch information
rsokl authored Jan 1, 2025
2 parents 4507fa7 + 8eafea6 commit 3a09abb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/math/unary/test_scipy_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import pytest
from hypothesis import given, settings
from numpy.testing import assert_array_equal
from numpy.testing import assert_allclose
from scipy import special

from mygrad.math._special import logsumexp
Expand All @@ -26,9 +26,11 @@ def test_logsumexp(data: st.SearchStrategy, x: np.ndarray, keepdims: bool):
axes = data.draw(valid_axes(ndim=x.ndim), label="axes")
mygrad_result = logsumexp(x, axis=axes, keepdims=keepdims)
scipy_result = special.logsumexp(x, axis=axes, keepdims=keepdims)
assert_array_equal(
mygrad_result,
scipy_result,
assert_allclose(
actual=mygrad_result,
desired=scipy_result,
err_msg="mygrad's implementation of logsumexp does "
"not match that of scipy's",
atol=1e-8,
rtol=1e-8,
)

0 comments on commit 3a09abb

Please sign in to comment.