We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
to_device
1 parent 2b5e289 commit 7c3d68cCopy full SHA for 7c3d68c
tests/test_cupy.py
@@ -8,15 +8,17 @@
8
def test_to_device_with_stream():
9
devices = xp.__array_namespace_info__().devices()
10
streams = [
11
- Stream(),
12
- Stream(non_blocking=True),
13
- Stream(null=True),
14
- Stream(ptds=True),
15
- 123, # dlpack stream
+ lambda: Stream(),
+ lambda: Stream(non_blocking=True),
+ lambda: Stream(null=True),
+ lambda: Stream(ptds=True),
+ lambda: 123, # dlpack stream
16
]
17
18
a = xp.asarray([1, 2, 3])
19
for dev in devices:
20
- for stream in streams:
+ for stream_gen in streams:
21
+ with dev:
22
+ stream = stream_gen()
23
b = to_device(a, dev, stream=stream)
24
assert device(b) == dev
0 commit comments