()
| 80 | |
| 81 | |
| 82 | def test_bn_no_track_stat(): |
| 83 | nchannel = 3 |
| 84 | m = BatchNorm2d(nchannel, track_running_stats=False) |
| 85 | |
| 86 | gm = ad.GradManager().attach(m.parameters()) |
| 87 | optim = optimizer.SGD(m.parameters(), lr=1.0) |
| 88 | optim.clear_grad() |
| 89 | |
| 90 | data = tensor(np.random.random((6, nchannel, 2, 2)).astype("float32")) |
| 91 | with gm: |
| 92 | loss = m(data).sum() |
| 93 | gm.backward(loss) |
| 94 | optim.step() |
| 95 | |
| 96 | |
| 97 | def test_bn_no_track_stat2(): |
nothing calls this directly
no test coverage detected