code: def assertCheckpointEqual(
      self,
      model,
      config,
      training_state,
      model_restored,
      config_restored,
      training_state_restored,
  ):
      optimizer_restored = training_state_restored.optimizer
      scheduler_restored = training_state_restored.scheduler
      self.assertOptimizerEqual(
          training_state.optimizer, optimizer_restored
      )
      self.assertEqual(
          training_state.start_time, training_state_restored.start_time
      )
      self.assertEqual(
          training_state.epoch, training_state_restored.epoch
      )
      self.assertEqual(
          training_state.rank, training_state_restored.rank
      )
      self.assertEqual(
          training_state.stage, training_state_restored.stage
      )
      self.assertEqual(
          training_state.epochs_since_last_improvement,
          training_state_restored.epochs_since_last_improvement,
      )
      self.assertIsNotNone(scheduler_restored)
      self.assertIsNotNone(config_restored)
      self.assertModulesEqual(model, model_restored)
      model.eval()
      model_restored.eval()
      inputs = torch.LongTensor([[1, 2, 3]]), torch.LongTensor([3])
      self.assertEqual(
          model(*inputs).tolist(), model_restored(*inputs).tolist()
      )
  
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 4 for calling the TaskLoadSaveTest obj's underlying member method code with example usage: obj.assertCheckpointEqual(model, config, training_state, model_restored, config_restored, training_state_restored) without return types