code: def _compare_momentum_values(self, optim1, optim2):
      self.assertEqual(
          len(optim1["param_groups"]), len(optim2["param_groups"])
      )
  
      for i in range(len(optim1["param_groups"])):
          self.assertEqual(
              len(optim1["param_groups"][i]["params"]),
              len(optim2["param_groups"][i]["params"]),
          )
          if self._check_momentum_buffer():
              for j in range(len(optim1["param_groups"][i]["params"])):
                  id1 = optim1["param_groups"][i]["params"][j]
                  id2 = optim2["param_groups"][i]["params"][j]
                  self.assertTrue(
                      torch.allclose(
                          optim1["state"][id1]["momentum_buffer"],
                          optim2["state"][id2]["momentum_buffer"],
                      )
                  )
  
imports: from abc import ABC, abstractmethod
  from unittest.mock import MagicMock
  import torch
  import torch.nn
  from classy_vision.generic.util import split_batchnorm_params
  from classy_vision.models import ClassyModel
  from classy_vision.optim import build_optimizer, build_optimizer_schedulers
  from classy_vision.optim.param_scheduler import LinearParamScheduler
label_desc: Use image node_id 6 for calling the TestOptimizer obj's underlying member method code with example usage: obj._compare_momentum_values(optim1, optim2) without return types