From 8eafea6d9292ce03efaaaad9ba1e91853f57ea7a Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Tue, 31 Dec 2024 11:08:11 -0500 Subject: [PATCH] Loosen test requirements --- tests/math/unary/test_scipy_mirror.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/math/unary/test_scipy_mirror.py b/tests/math/unary/test_scipy_mirror.py index 5892dca5..fa7968fe 100644 --- a/tests/math/unary/test_scipy_mirror.py +++ b/tests/math/unary/test_scipy_mirror.py @@ -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 @@ -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, )