|
4 | 4 |
|
5 | 5 | import numpy as np
|
6 | 6 |
|
7 |
| -from scipy._lib._array_api import is_array_api_strict, xp_default_dtype, xp_device |
| 7 | +from scipy._lib._array_api import (is_array_api_strict, make_skip_xp_backends, |
| 8 | + xp_default_dtype, xp_device) |
8 | 9 | from scipy._lib._array_api_no_0d import (xp_assert_equal, xp_assert_close,
|
9 | 10 | xp_assert_less)
|
10 | 11 |
|
@@ -38,6 +39,7 @@ def test_wrap_radians(xp):
|
38 | 39 | @pytest.mark.filterwarnings("ignore:invalid value encountered:RuntimeWarning")
|
39 | 40 | @pytest.mark.filterwarnings("ignore:divide by zero encountered:RuntimeWarning")
|
40 | 41 | @pytest.mark.filterwarnings("ignore:overflow encountered:RuntimeWarning")
|
| 42 | +@make_skip_xp_backends(logsumexp) |
41 | 43 | class TestLogSumExp:
|
42 | 44 | def test_logsumexp(self, xp):
|
43 | 45 | # Test with zero-size array
|
@@ -310,6 +312,7 @@ def test_device(self, x_raw, xp, devices):
|
310 | 312 | assert xp_device(logsumexp(x, b=x)) == xp_device(x)
|
311 | 313 |
|
312 | 314 |
|
| 315 | +@make_skip_xp_backends(softmax) |
313 | 316 | class TestSoftmax:
|
314 | 317 | def test_softmax_fixtures(self, xp):
|
315 | 318 | xp_assert_close(softmax(xp.asarray([1000., 0., 0., 0.])),
|
@@ -378,6 +381,7 @@ def test_softmax_array_like(self):
|
378 | 381 | np.asarray([1., 0., 0., 0.]), rtol=1e-13)
|
379 | 382 |
|
380 | 383 |
|
| 384 | +@make_skip_xp_backends(log_softmax) |
381 | 385 | class TestLogSoftmax:
|
382 | 386 | def test_log_softmax_basic(self, xp):
|
383 | 387 | xp_assert_close(log_softmax(xp.asarray([1000., 1.])),
|
|
0 commit comments