We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 502a2d9 commit a4dc839Copy full SHA for a4dc839
1 file changed
array_api_tests/test_dlpack.py
@@ -21,6 +21,15 @@ class DLPackDeviceEnum(Enum):
21
ONE_API = 14
22
23
24
+def filter_meta(devices):
25
+ # hack: filter out torch.device(type="meta")
26
+ try:
27
+ import torch
28
+ return [x for x in devices if x != torch.device(type="meta")]
29
+ except Exception:
30
+ return devices
31
+
32
33
@given(dtype=hh.all_dtypes, data=st.data())
34
def test_dlpack_device(dtype, data):
35
"""Test the array object __dlpack_device__ method."""
@@ -39,6 +48,7 @@ def test_dlpack_device(dtype, data):
39
48
)
40
49
def test_from_dlpack(x, copy_kw, data):
41
50
devices = xp.__array_namespace_info__().devices()
51
+ devices = filter_meta(devices)
42
52
tgt_device_kw = data.draw(
43
53
hh.kwargs(device=st.sampled_from(devices) | st.none())
44
54
0 commit comments