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

Method test_dist_opt_fp16

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

Source from the content-addressed store, hash-verified

64 decimal=5)
65
66 def test_dist_opt_fp16(self):
67 # Test the C++ all reduce operation in fp16
68
69 param.set_value(10)
70 grad.set_value(1)
71
72 sgd.all_reduce_half(grad.data)
73 sgd.wait()
74 sgd.update(param, grad)
75
76 np.testing.assert_array_almost_equal(tensor.to_numpy(param),
77 expected,
78 decimal=5)
79
80 def test_dist_opt_fp16_fused(self):
81 # Test the C++ all reduce operation in fp16

Callers

nothing calls this directly

Calls 4

all_reduce_halfMethod · 0.80
set_valueMethod · 0.45
waitMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected