(inputs, expected)
| 377 | ], |
| 378 | ) |
| 379 | def test_rewrite(inputs, expected): |
| 380 | inputs = [ |
| 381 | Blockwise( |
| 382 | *inp, numblocks={k: (1,) * len(v) for k, v in inp[-1] if v is not None} |
| 383 | ) |
| 384 | for inp in inputs |
| 385 | ] |
| 386 | result = rewrite_blockwise(inputs) |
| 387 | |
| 388 | result2 = ( |
| 389 | result.output, |
| 390 | "".join(result.output_indices), |
| 391 | result.task, |
| 392 | [ |
| 393 | (name, "".join(ind) if ind is not None else ind) |
| 394 | for name, ind in result.indices |
| 395 | ], |
| 396 | ) |
| 397 | # Assert on the task first to get a more informative error message |
| 398 | assert result2[2] == expected[2] |
| 399 | assert result2 == expected |
| 400 | |
| 401 | |
| 402 | def test_index_subs(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…