(self)
| 35 | |
| 36 | |
| 37 | def test_dist_opt_fp32(self): |
| 38 | # Test the C++ all reduce operation in fp32 |
| 39 | |
| 40 | param.set_value(10) |
| 41 | grad.set_value(1) |
| 42 | |
| 43 | sgd.all_reduce(grad.data) |
| 44 | sgd.wait() |
| 45 | sgd.update(param, grad) |
| 46 | |
| 47 | np.testing.assert_array_almost_equal(tensor.to_numpy(param), |
| 48 | expected, |
| 49 | decimal=5) |
| 50 | |
| 51 | def test_dist_opt_fp32_fused(self): |
| 52 | # Test the C++ all reduce operation in fp32 |
nothing calls this directly
no test coverage detected