code: def test_multi_params_different_devices_throws(self):
      sizes = [[4096, 1024], [4096], [4096, 2048], [32320, 1024], [1]]
      adagrad_option = {"lr": 5e-4, "eps": 1e-08, "weight_decay": 0}
  
      tensors = []
      for i, size in enumerate(sizes):
          tensors.append(
              torch.rand(
                  size, dtype=torch.float, device="cuda:" + str(i % 2)
              )
          )
      ref_param, tst_param, ref_optim, tst_optim = self.gen_param_optim(
          tensors, adagrad_option
      )
      self.gen_grad(ref_param, tst_param)
      with self.assertRaisesRegex(
          RuntimeError, "not on the same device"
      ):
          tst_optim.step()
  
imports: from itertools import product
  import random
  import unittest
  import torch
  import apex
label_desc: Use image node_id 6 for calling the TestFusedAdagrad obj's underlying member method code with example usage: obj.test_multi_params_different_devices_throws() without return types