MCPcopy Create free account
hub / github.com/dask/dask / test_vindex

Function test_vindex

dask/array/tests/test_cupy_core.py:172–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170
171
172def test_vindex():
173 x_np = np.arange(56).reshape((7, 8))
174 x_cp = cupy.arange(56).reshape((7, 8))
175
176 d_np = da.from_array(x_np, chunks=(3, 4))
177 d_cp = da.from_array(x_cp, chunks=(3, 4))
178
179 res_np = da.core._vindex(d_np, [0, 1, 6, 0], [0, 1, 0, 7])
180 res_cp = da.core._vindex(d_cp, [0, 1, 6, 0], [0, 1, 0, 7])
181
182 assert type(res_cp._meta) == cupy.ndarray
183 assert_eq(
184 res_cp, res_cp, check_type=False
185 ) # Check that _meta and computed arrays match types
186
187 assert_eq(res_np, res_cp, check_type=False)
188
189
190def test_view():

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
reshapeMethod · 0.80
_vindexMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected