()
| 474 | |
| 475 | |
| 476 | def test_reduce_axis_names(): |
| 477 | reductions = [ |
| 478 | fn.reductions.max, |
| 479 | fn.reductions.min, |
| 480 | fn.reductions.mean, |
| 481 | fn.reductions.mean_square, |
| 482 | fn.reductions.sum, |
| 483 | fn.reductions.rms, |
| 484 | ] |
| 485 | |
| 486 | reductions_with_mean_input = [fn.reductions.std_dev, fn.reductions.variance] |
| 487 | |
| 488 | batch_fn = Batch3D(np.float32) |
| 489 | batch_size = batch_fn.batch_size() |
| 490 | |
| 491 | def get_batch(): |
| 492 | return batch_fn() |
| 493 | |
| 494 | axes_and_names = [ |
| 495 | ((), ""), |
| 496 | (0, "A"), |
| 497 | (1, "B"), |
| 498 | (2, "C"), |
| 499 | ((0, 1), "AB"), |
| 500 | ((0, 2), "AC"), |
| 501 | ((1, 2), "BC"), |
| 502 | ((0, 1, 2), "ABC"), |
| 503 | ] |
| 504 | |
| 505 | for axes, axis_names in axes_and_names: |
| 506 | for reduction in reductions: |
| 507 | yield ( |
| 508 | run_reduce_with_layout, |
| 509 | batch_size, |
| 510 | get_batch, |
| 511 | reduction, |
| 512 | axes, |
| 513 | axis_names, |
| 514 | batch_fn, |
| 515 | ) |
| 516 | for reduction in reductions_with_mean_input: |
| 517 | yield ( |
| 518 | run_reduce_with_layout_with_mean_input, |
| 519 | batch_size, |
| 520 | get_batch, |
| 521 | reduction, |
| 522 | axes, |
| 523 | axis_names, |
| 524 | batch_fn, |
| 525 | ) |
| 526 | |
| 527 | |
| 528 | _random_buf = None |
nothing calls this directly
no test coverage detected