From 8fff4697c7f21417dcc2a08abacc0a3e68467213 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Tue, 8 Apr 2025 15:01:39 +0200 Subject: [PATCH] test_clip: make sure `min` and `max` have the same dtype as `x` Per the spec: 'should have the same dtype as x' --- array_api_tests/test_operators_and_elementwise_functions.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py index 0df00e0e..82ab3351 100644 --- a/array_api_tests/test_operators_and_elementwise_functions.py +++ b/array_api_tests/test_operators_and_elementwise_functions.py @@ -987,17 +987,15 @@ def test_clip(x, data): base_shape=x.shape), label="min.shape, max.shape") - dtypes = hh.real_floating_dtypes if dh.is_float_dtype(x.dtype) else hh.int_dtypes - min = data.draw(st.one_of( st.none(), hh.scalars(dtypes=st.just(x.dtype)), - hh.arrays(dtype=dtypes, shape=shape1), + hh.arrays(dtype=st.just(x.dtype), shape=shape1), ), label="min") max = data.draw(st.one_of( st.none(), hh.scalars(dtypes=st.just(x.dtype)), - hh.arrays(dtype=dtypes, shape=shape2), + hh.arrays(dtype=st.just(x.dtype), shape=shape2), ), label="max") # min > max is undefined (but allow nans)