MCPcopy Create free account
hub / github.com/apache/singa / test_dist_opt_fp32

Method test_dist_opt_fp32

test/python/test_dist.py:37–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

all_reduceMethod · 0.80
set_valueMethod · 0.45
waitMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected