MCPcopy
hub / github.com/dask/dask / test_basic

Function test_basic

dask/array/tests/test_cupy_core.py:129–145  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

127
128@pytest.mark.parametrize("func", functions)
129def test_basic(func):
130 c = cupy.random.default_rng().random((2, 3, 4))
131 n = c.get()
132 dc = da.from_array(c, chunks=(1, 2, 2), asarray=False)
133 dn = da.from_array(n, chunks=(1, 2, 2))
134
135 ddc = func(dc)
136 ddn = func(dn)
137
138 assert type(ddc._meta) is cupy.ndarray
139
140 if next(iter(ddc.dask.keys()))[0].startswith("empty"):
141 # We can't verify for data correctness when testing empty_like
142 assert type(ddc._meta) is type(ddc.compute())
143 else:
144 assert_eq(ddc, ddc) # Check that _meta and computed arrays match types
145 assert_eq(ddc, ddn, check_type=False)
146
147
148@pytest.mark.parametrize("dtype", ["f4", "f8"])

Callers

nothing calls this directly

Calls 6

assert_eqFunction · 0.90
funcFunction · 0.70
randomMethod · 0.45
getMethod · 0.45
keysMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…