code: def assertOptimizerEqual(self, optim_1, optim_2, msg=None):
      self.assertTrue(
          type(optim_1) is Adam and type(optim_2) is Adam, msg
      )
      state_dict_1 = optim_1.state_dict()
      state_dict_2 = optim_2.state_dict()
      self.assertEqual(len(state_dict_1), len(state_dict_2))
  
      params_1 = optim_1.state_dict()["param_groups"][0]["params"]
      params_2 = optim_1.state_dict()["param_groups"][0]["params"]
      self.assertEqual(len(params_1), len(params_2), msg)
  
imports: import itertools
  import tempfile
  import unittest
  import torch
  from pytext.common.constants import Stage
  from pytext.config import LATEST_VERSION, PyTextConfig
  from pytext.config.component import create_optimizer, create_scheduler
  from pytext.data import Data
  from pytext.data.sources.tsv import BlockShardedTSVDataSource, TSVDataSource
  from pytext.optimizer import Adam
  from pytext.optimizer.scheduler import Scheduler
  from pytext.task import create_task
  from pytext.task.serialize import get_latest_checkpoint_path, load, save
  from pytext.task.tasks import DocumentClassificationTask
  from pytext.trainers.training_state import TrainingState
  from pytext.utils import test
label_desc: Use image node_id 3 for calling the TaskLoadSaveTest obj's underlying member method code with example usage: obj.assertOptimizerEqual(optim_1, optim_2, msg) without return types