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

Method test_const_decay_scheduler

test/python/test_opt.py:70–76  ·  view source on GitHub ↗
(self, dev)

Source from the content-addressed store, hash-verified

68
69 @on_cpu_gpu
70 def test_const_decay_scheduler(self, dev):
71 c1 = opt.Constant(0.2)
72 step = tensor.Tensor((1,), device=dev).set_value(0)
73 lr_val = c1(step)
74 np.testing.assert_array_almost_equal(tensor.to_numpy(c1(step)) , [0.2])
75 step+=1
76 np.testing.assert_array_almost_equal(tensor.to_numpy(c1(step)) , [0.2])
77
78class TestOptimizer(unittest.TestCase):
79 @on_cpu_gpu

Callers

nothing calls this directly

Calls 3

ConstantMethod · 0.80
TensorMethod · 0.80
set_valueMethod · 0.45

Tested by

no test coverage detected