(self)
| 93 | decimal=5) |
| 94 | |
| 95 | def test_dist_opt_spars_value(self): |
| 96 | # Test the C++ value based sparsification operation for all reduce |
| 97 | |
| 98 | param.set_value(10) |
| 99 | grad.set_value(1) |
| 100 | |
| 101 | sgd.sparsification(grad.data, accumulation=None, spars=0.05, topK=False) |
| 102 | sgd.wait() |
| 103 | sgd.update(param, grad) |
| 104 | |
| 105 | np.testing.assert_array_almost_equal(tensor.to_numpy(param), |
| 106 | expected, |
| 107 | decimal=5) |
| 108 | |
| 109 | def test_dist_opt_spars_topk(self): |
| 110 | # Test the C++ TopK based sparsification operation for all reduce |
nothing calls this directly
no test coverage detected