Skip to content

Commit 8fff469

Browse files
committed
test_clip: make sure min and max have the same dtype as x
Per the spec: 'should have the same dtype as x'
1 parent c48410f commit 8fff469

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

array_api_tests/test_operators_and_elementwise_functions.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -987,17 +987,15 @@ def test_clip(x, data):
987987
base_shape=x.shape),
988988
label="min.shape, max.shape")
989989

990-
dtypes = hh.real_floating_dtypes if dh.is_float_dtype(x.dtype) else hh.int_dtypes
991-
992990
min = data.draw(st.one_of(
993991
st.none(),
994992
hh.scalars(dtypes=st.just(x.dtype)),
995-
hh.arrays(dtype=dtypes, shape=shape1),
993+
hh.arrays(dtype=st.just(x.dtype), shape=shape1),
996994
), label="min")
997995
max = data.draw(st.one_of(
998996
st.none(),
999997
hh.scalars(dtypes=st.just(x.dtype)),
1000-
hh.arrays(dtype=dtypes, shape=shape2),
998+
hh.arrays(dtype=st.just(x.dtype), shape=shape2),
1001999
), label="max")
10021000

10031001
# min > max is undefined (but allow nans)

0 commit comments

Comments
 (0)