Skip to content

Commit a8cbdb5

Browse files
committed
TST: use per-device dtypes in test_elementwise_functions
1 parent 4817e08 commit a8cbdb5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

array_api_strict/tests/test_elementwise_functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
int64,
2222
uint64,
2323
)
24+
from .._info import __array_namespace_info__
2425
from .test_array_object import _check_op_array_scalar, BIG_INT
2526

2627
import array_api_strict
@@ -144,6 +145,10 @@ def _array_vals(dtypes):
144145
yield asarray(1., dtype=dtype, device=device)
145146

146147
dtypes = _dtype_categories[types]
148+
149+
supported_dtypes = __array_namespace_info__().dtypes(device=device)
150+
dtypes = [dt for dt in dtypes if dt in supported_dtypes]
151+
147152
func = getattr(_elementwise_functions, func_name)
148153

149154
for x in _array_vals(dtypes):

0 commit comments

Comments
 (0)