(rank, axes, device, in_layout)
| 651 | |
| 652 | @nottest |
| 653 | def _test_std_dev_large_data(rank, axes, device, in_layout): |
| 654 | batch_size = 16 |
| 655 | num_batches = 2 |
| 656 | data = fast_large_random_batches(rank, batch_size, num_batches) |
| 657 | |
| 658 | pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=0 if device == "gpu" else None) |
| 659 | input = fn.external_source(data, cycle=True, device=device, layout=in_layout) |
| 660 | mean = fn.reductions.mean(input, axes=axes) |
| 661 | reduced = fn.reductions.std_dev(input, mean, axes=axes, ddof=0) |
| 662 | pipe.set_outputs(reduced) |
| 663 | |
| 664 | for b, batch in enumerate(data): |
| 665 | (out,) = pipe.run() |
| 666 | check_layout(out, in_layout, axes, False) |
| 667 | if device == "gpu": |
| 668 | out = out.as_cpu() |
| 669 | for i in range(batch_size): |
| 670 | ref = np.std(batch[i].astype(np.float64), axis=axes, ddof=0) |
| 671 | assert np.allclose(out[i], ref, 1e-5, 1e-5) |
| 672 | |
| 673 | |
| 674 | def test_std_dev_large_data(): |
nothing calls this directly
no test coverage detected