MCPcopy
hub / github.com/dask/dask / test_matmul

Function test_matmul

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

Source from the content-addressed store, hash-verified

1305
1306
1307def test_matmul():
1308 rng = np.random.default_rng()
1309 x = rng.random((5, 5))
1310 y = rng.random((5, 2))
1311 a = from_array(x, chunks=(1, 5))
1312 b = from_array(y, chunks=(5, 1))
1313 assert_eq(operator.matmul(a, b), a.dot(b))
1314 assert_eq(operator.matmul(a, b), operator.matmul(x, y))
1315 assert_eq(operator.matmul(a, y), operator.matmul(x, b))
1316 list_vec = list(range(1, 6))
1317 assert_eq(operator.matmul(list_vec, b), operator.matmul(list_vec, y))
1318 assert_eq(operator.matmul(x, list_vec), operator.matmul(a, list_vec))
1319 z = rng.random((5, 5, 5))
1320 c = from_array(z, chunks=(1, 5, 1))
1321 assert_eq(operator.matmul(a, z), operator.matmul(x, c))
1322 assert_eq(operator.matmul(z, a), operator.matmul(c, x))
1323
1324
1325def test_matmul_array_ufunc():

Callers

nothing calls this directly

Calls 4

from_arrayFunction · 0.90
assert_eqFunction · 0.90
randomMethod · 0.45
dotMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…