code: def test_cpu_adagrad_opt(self, model_size=64):
      device = "cpu"
      rng_state = torch.get_rng_state()
      param = torch.nn.Parameter(torch.randn(model_size, device=device))
      torch.set_rng_state(rng_state)
      param1 = torch.nn.Parameter(
          torch.randn(model_size, device=device)
      )
      torch.set_rng_state(rng_state)
  
      optimizer = DeepSpeedCPUAdagrad([param])
      optimizer1 = torch.optim.Adagrad([param1])
  
      for i in range(10):
          rng_state = torch.get_rng_state()
          param.grad = torch.randn(model_size, device=device)
          torch.set_rng_state(rng_state)
          param1.grad = torch.randn(model_size, device=device)
          optimizer.step()
          optimizer1.step()
  
      check_equal(param, param1, atol=1e-2, verbose=True)
  
file_path: DeepSpeed/tests/unit/ops/adagrad/test_cpu_adagrad.py
imports: import torch
  import numpy
  import pytest
  import deepspeed
  from deepspeed.ops.adagrad import DeepSpeedCPUAdagrad
  from deepspeed.accelerator import get_accelerator
  from deepspeed.ops.op_builder import CPUAdagradBuilder
  from unit.common import DistributedTest
label_desc: Use image node_id 1 for calling the TestCPUAdagrad obj's underlying member method code with example usage: obj.test_cpu_adagrad_opt(model_size) without return types