code: def test_sparse_adagrad():
      opt1 = PySparseAdaGrad
      opt2 = mx.optimizer.AdaGrad
      shapes = [(3, 4, 5), (10, 4), (7,)]
      eps_options = [{}, {"epsilon": 1e-8}]
      cg_options = [{}, {"clip_gradient": 0.4}, {"clip_gradient": 0.5}]
      rg_options = [{}, {"rescale_grad": 0.14}, {"rescale_grad": 0.8}]
      wd_options = [{}, {"wd": 0.0}]
      agg_options = [
          {"aggregate_num": 0},
          {"aggregate_num": 1},
          {"aggregate_num": 4},
          {"aggregate_num": np.inf},
      ]
      for dtype in [np.float16, np.float32]:
          for params in itertools.product(
              eps_options,
              cg_options,
              rg_options,
              wd_options,
              agg_options,
          ):
              kwarg = {
                  k: v for param in params for k, v in param.items()
              }
              if dtype is np.float16:
                  kwarg.update({"multi_precision": True})
              if kwarg.get("wd", 0.0) == 0.0:
                  compare_optimizer(
                      opt1(**kwarg),
                      opt2(use_fused_step=True, **kwarg),
                      shapes,
                      dtype,
                      w_stype="row_sparse",
                      g_stype="row_sparse",
                  )
                  compare_optimizer(
                      opt1(**kwarg),
                      opt2(use_fused_step=True, **kwarg),
                      shapes,
                      dtype,
                      g_stype="row_sparse",
                  )
  
imports: import itertools
  import numpy
  import itertools
  import mxnet
  import mxnet.lr_scheduler
  from mxnet import gluon
  import unittest
  import pytest
  import math
  from mxnet.test_utils import *
  from common import retry, xfail_when_nonstandard_decimal_separator
label_desc: Use image node_id 21 for calling a global function with example usage: test_sparse_adagrad() without return types