()
| 1341 | |
| 1342 | |
| 1343 | def test_broadcast_to(): |
| 1344 | x = np.random.default_rng().integers(10, size=(5, 1, 6)) |
| 1345 | a = from_array(x, chunks=(3, 1, 3)) |
| 1346 | |
| 1347 | for shape in [a.shape, (5, 0, 6), (5, 4, 6), (2, 5, 1, 6), (3, 4, 5, 4, 6)]: |
| 1348 | xb = np.broadcast_to(x, shape) |
| 1349 | ab = broadcast_to(a, shape) |
| 1350 | |
| 1351 | assert_eq(xb, ab) |
| 1352 | |
| 1353 | if a.shape == ab.shape: |
| 1354 | assert a is ab |
| 1355 | |
| 1356 | pytest.raises(ValueError, lambda: broadcast_to(a, (2, 1, 6))) |
| 1357 | pytest.raises(ValueError, lambda: broadcast_to(a, (3,))) |
| 1358 | |
| 1359 | |
| 1360 | def test_broadcast_to_array(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…