()
| 1305 | |
| 1306 | |
| 1307 | def 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 | |
| 1325 | def test_matmul_array_ufunc(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…