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

Function test_elemwise_uneven_chunks

dask/array/tests/test_array_core.py:4066–4081  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4064
4065
4066def test_elemwise_uneven_chunks():
4067 rng = da.random.default_rng()
4068 x = da.arange(10, chunks=((4, 6),))
4069 y = da.ones(10, chunks=((6, 4),))
4070
4071 assert_eq(x + y, np.arange(10) + np.ones(10))
4072
4073 z = x + y
4074 assert z.chunks == ((4, 2, 4),)
4075
4076 x = rng.random((10, 10), chunks=((4, 6), (5, 2, 3)))
4077 y = rng.random((4, 10, 10), chunks=((2, 2), (6, 4), (2, 3, 5)))
4078
4079 z = x + y
4080 assert_eq(x + y, x.compute() + y.compute())
4081 assert z.chunks == ((2, 2), (4, 2, 4), (2, 3, 2, 3))
4082
4083
4084def test_uneven_chunks_blockwise():

Callers

nothing calls this directly

Calls 5

assert_eqFunction · 0.90
arangeMethod · 0.45
onesMethod · 0.45
randomMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected