Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion array_api_tests/dtype_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ 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)
Comment thread
prady0t marked this conversation as resolved.
except TypeError:
x = xp.empty(2)
try:
x.__dlpack_device__()
except:
Expand Down
Loading