code: def _compare_optimizers(self, a, b):
      state_dict_a = a.state_dict()
      state_dict_b = b.state_dict()
      state_a = state_dict_a["state"]
      state_b = state_dict_b["state"]
  
      same = True
      same = same and list(state_a.keys()) == list(state_b.keys())
      same = (
          same
          and state_dict_a["param_groups"]
          == state_dict_b["param_groups"]
      )
  
      for item1, item2 in zip(state_a.values(), state_b.values()):
          same = same and compare_state_dicts(item1, item2)
  
      return same
  
imports: import contextlib
  import os
  import tempfile
  import unittest
  from copy import deepcopy
  from io import StringIO
  from unittest.mock import Mock, patch
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.trainers.callbacks.checkpoint import CheckpointCallback
  from mmf.trainers.callbacks.early_stopping import EarlyStoppingCallback
  from mmf.trainers.callbacks.lr_scheduler import LRSchedulerCallback
  from mmf.utils.checkpoint import Checkpoint
  from mmf.utils.configuration import load_yaml
  from mmf.utils.file_io import PathManager
  from omegaconf import OmegaConf
  from tests.test_utils import compare_state_dicts, skip_if_no_cuda
label_desc: Use image node_id 14 for calling the TestUtilsCheckpoint obj's underlying member method code with example usage: obj._compare_optimizers(a, b) and returns: same