Skip to content

Commit ab69980

Browse files
authored
Merge pull request #141 from honno/forgiving-linspace
Filter out large distances in `test_linspace`
2 parents adfee28 + 0bc7a16 commit ab69980

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

array_api_tests/test_creation_functions.py

+3
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,9 @@ def test_linspace(num, dtype, endpoint, data):
445445
# avoid overflow errors
446446
assume(not xp.isnan(xp.asarray(stop - start, dtype=_dtype)))
447447
assume(not xp.isnan(xp.asarray(start - stop, dtype=_dtype)))
448+
# avoid generating very large distances
449+
# https://github.com/data-apis/array-api-tests/issues/125
450+
assume(abs(stop - start) < dh.dtype_ranges[dtype].max)
448451

449452
kw = data.draw(
450453
hh.specified_kwargs(

0 commit comments

Comments
 (0)