(self, dev)
| 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 | |
| 78 | class TestOptimizer(unittest.TestCase): |
| 79 | @on_cpu_gpu |