code: def test_Adam_const_lr(self, dev=cpu_dev):
      cpu_dev.EnableGraph(False)
      opt1 = opt.Adam(lr=0.1)
      w_shape = (2, 3)
      w = tensor.Tensor(w_shape, device=dev).set_value(1.0)
      g = tensor.Tensor(w_shape, device=dev).set_value(0.1)
  
      # m := beta_1 * m + (1 - beta_1) * grad
      # v := beta_2 * v + (1 - beta_2) * grad * grad
      # m_norm = m / (1 - beta_1 ^ step)
      # v_norm = v / (1 - beta_2 ^ step)
      # param := param - (lr * m_norm) / ( sqrt(v_norm) + epsilon) )
  
      m = 0.1 * g
      tmp = tensor.square(g)
      v = 0.001 * tmp
  
      m_norm = m / 0.1
      v_norm = v / 0.001
  
      tmp = tensor.sqrt(v_norm) + 1e-8
      tmp = m_norm / tmp
  
      w_step1 = w - 0.1 * tmp
      opt1.apply(w.name, w, g)
  
      assertTensorEqual(w, w_step1, decimal=5)
  
imports: from __future__ import division
  import math
  import unittest
  import numpy
  import functools
  from singa import tensor
  from singa import singa_wrap
  from singa import opt
  from cuda_helper import gpu_dev, cpu_dev
label_desc: Use image node_id 5 for calling the TestOptimizer obj's underlying member method code with example usage: obj.test_Adam_const_lr(dev) without return types