diff --git a/array_api_tests/dtype_helpers.py b/array_api_tests/dtype_helpers.py index 9fe2c7b1..bffefa8b 100644 --- a/array_api_tests/dtype_helpers.py +++ b/array_api_tests/dtype_helpers.py @@ -203,7 +203,11 @@ def is_device_dlpack_compatible(device): """If device is dlpack compatible, return True, else False""" # XXX: there seems to be no better way than try-catch for __dlpack_device__() - x = xp.empty(2, device=device) + try: + x = xp.empty(2, device=device) + except: + # also covers libraries that does not support device parameter + x = xp.empty(2) try: x.__dlpack_device__() except: