We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c77aca1 commit 9ffc9b3Copy full SHA for 9ffc9b3
sklearn/utils/tests/test_array_api.py
@@ -156,9 +156,10 @@ def test_move_to_array_api_conversions(array_input, reference):
156
157
with config_context(array_api_dispatch=True):
158
array_in = xp_from.asarray([1, 2, 3], device=array_input.device)
159
- array_out = move_to(array_in, xp=xp_to, device=reference.device)
+ device_reference = device(xp_to.asarray([1], device=reference.device))
160
+ array_out = move_to(array_in, xp=xp_to, device=device_reference)
161
assert get_namespace(array_out)[0] == xp_to
- assert device(array_out) == device(xp_to.asarray([1], device=reference.device))
162
+ assert device(array_out) == device_reference
163
164
165
def test_move_to_sparse():
@@ -167,7 +168,6 @@ def test_move_to_sparse():
167
168
xp_torch = _array_api_for_tests("torch", "cpu")
169
170
sparse1 = sp.csr_array([0, 1, 2, 3])
- sparse2 = sp.csr_array([0, 1, 0, 1])
171
numpy_array = numpy.array([1, 2, 3])
172
173
0 commit comments