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

Function test_blockwise_literals

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

Source from the content-addressed store, hash-verified

252
253
254def test_blockwise_literals():
255 x = da.ones((10, 10), chunks=(5, 5))
256 z = da.blockwise(add, "ij", x, "ij", 100, None, dtype=x.dtype)
257 assert_eq(z, x + 100)
258
259 z = da.blockwise(
260 lambda x, y, z: x * y + z, "ij", 2, None, x, "ij", 100, None, dtype=x.dtype
261 )
262 assert_eq(z, 2 * x + 100)
263
264 z = da.blockwise(getitem, "ij", x, "ij", slice(None), None, dtype=x.dtype)
265 assert_eq(z, x)
266
267
268def test_blockwise_1_in_shape_I():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
onesMethod · 0.45

Tested by

no test coverage detected