Skip to content

Commit 2c3c6b0

Browse files
authored
Decrease array size for stability (#1227)
1 parent ebe4f2a commit 2c3c6b0

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

tests/test_arraycreation.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[0, -5, 10, -2.5, 9.7],
1313
ids=['0', '-5', '10', '-2.5', '9.7'])
1414
@pytest.mark.parametrize("stop",
15-
[None, 10, -2, 20.5, 10**5],
15+
[None, 10, -2, 20.5, 1000],
1616
ids=['None', '10', '-2', '20.5', '10**5'])
1717
@pytest.mark.parametrize("step",
1818
[None, 1, 2.7, -1.6, 100],
@@ -26,17 +26,6 @@ def test_arange(start, stop, step, dtype):
2626
# numpy casts to float32 type when computes float16 data
2727
rtol_mult = 4
2828

29-
# secure there is no 'inf' elements in resulting array
30-
max = numpy.finfo(dtype).max
31-
if stop is not None and stop > max:
32-
# consider comulative accuracy while generating array
33-
# to calculate maximum allowed 'stop' value for dtype=float16
34-
arr_len = (max - start) / (step if step is not None else 1)
35-
arr_ilen = int(arr_len)
36-
arr_len = (arr_ilen + 1) if float(arr_ilen) < arr_len else arr_ilen
37-
acc = rtol_mult * numpy.finfo(dtype).eps
38-
stop = max - acc * arr_len
39-
4029
exp_array = numpy.arange(start, stop=stop, step=step, dtype=dtype)
4130

4231
dpnp_array = dpnp.arange(start, stop=stop, step=step, dtype=dtype)

0 commit comments

Comments
 (0)