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

Method test_dist_opt_fp32_fused

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

Source from the content-addressed store, hash-verified

49 decimal=5)
50
51 def test_dist_opt_fp32_fused(self):
52 # Test the C++ all reduce operation in fp32
53
54 param.set_value(10)
55 grad.set_value(1)
56
57 sgd.fused_all_reduce([grad.data], send=False)
58 sgd.fused_all_reduce([grad.data])
59 sgd.wait()
60 sgd.update(param, grad)
61
62 np.testing.assert_array_almost_equal(tensor.to_numpy(param),
63 expected,
64 decimal=5)
65
66 def test_dist_opt_fp16(self):
67 # Test the C++ all reduce operation in fp16

Callers

nothing calls this directly

Calls 4

fused_all_reduceMethod · 0.80
set_valueMethod · 0.45
waitMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected