code: def test_AdaGrad_const_lr(self, dev=cpu_dev):
      cpu_dev.EnableGraph(False)
      opt1 = opt.AdaGrad(lr=0.1)
      w_shape = (2, 3)
      w = tensor.Tensor(w_shape, device=dev).set_value(0.1)
      g = tensor.Tensor(w_shape, device=dev).set_value(0.1)
  
      # history = history + param_grad * param_grad
      # param_value = param_value - lr * param_grad / sqrt(history + epsilon)
  
      history = tensor.square(g)
      tmp = history + 1e-8
      tmp = tensor.sqrt(tmp)
      tmp = g / tmp
  
      w_step1 = w - 0.1 * tmp
      opt1.apply(w.name, w, g)
  
      assertTensorEqual(w, w_step1)
  
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 4 for calling the TestOptimizer obj's underlying member method code with example usage: obj.test_AdaGrad_const_lr(dev) without return types