Skip to content

Commit a194344

Browse files
committed
Update cupy buffer protocol copy test
1 parent 166c650 commit a194344

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,8 @@ def test_asarray_copy(library):
170170
b = asarray(a, copy=None)
171171
assert is_lib_func(b)
172172
a[0] = 0.0
173-
assert all(b[0] == 0.0)
173+
if library == 'cupy':
174+
# A copy is required for libraries where the default device is not CPU
175+
assert all(b[0] == 1.0)
176+
else:
177+
assert all(b[0] == 0.0)

0 commit comments

Comments
 (0)