(self)
| 107 | decimal=5) |
| 108 | |
| 109 | def test_dist_opt_spars_topk(self): |
| 110 | # Test the C++ TopK based sparsification operation for all reduce |
| 111 | |
| 112 | param.set_value(10) |
| 113 | grad.set_value(1) |
| 114 | |
| 115 | sgd.sparsification(grad.data, accumulation=None, spars=1, topK=True) |
| 116 | sgd.wait() |
| 117 | sgd.update(param, grad) |
| 118 | |
| 119 | np.testing.assert_array_almost_equal(tensor.to_numpy(param), |
| 120 | expected, |
| 121 | decimal=5) |
| 122 | |
| 123 | |
| 124 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected