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

Function test_sparse_hstack_vstack_csr

dask/array/tests/test_cupy_sparse.py:14–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def test_sparse_hstack_vstack_csr():
15 pytest.importorskip("cupyx")
16 x = cupy.arange(24, dtype=cupy.float32).reshape(4, 6)
17
18 sp = da.from_array(x, chunks=(2, 3), asarray=False, fancy=False)
19 sp = sp.map_blocks(cupyx.scipy.sparse.csr_matrix, dtype=cupy.float32)
20
21 y = sp.compute()
22
23 assert cupyx.scipy.sparse.isspmatrix(y)
24 assert_eq(x, y.todense())
25
26
27@pytest.mark.parametrize("axis", [0, 1])

Callers

nothing calls this directly

Calls 5

assert_eqFunction · 0.90
reshapeMethod · 0.80
arangeMethod · 0.45
map_blocksMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected