docstr: Tests checkpointing by running train_steps to make sure the train_steps
  run the same way after loading from a checkpoint.
code: def test_checkpointing(self):
      """
      Tests checkpointing by running train_steps to make sure the train_steps
      run the same way after loading from a checkpoint.
      """
      config = get_fast_test_task_config()
      task = build_task(config).set_hooks([LossLrMeterLoggingHook()])
      task_2 = build_task(config).set_hooks([LossLrMeterLoggingHook()])
  
      task.set_use_gpu(torch.cuda.is_available())
  
      # only train 1 phase at a time
      trainer = LimitedPhaseTrainer(num_phases=1)
  
      while not task.done_training():
          # set task's state as task_2's checkpoint
          task_2._set_checkpoint_dict(
              get_checkpoint_dict(task, {}, deep_copy=True)
          )
  
          # task 2 should have the same state before training
          self._compare_states(
              task.get_classy_state(), task_2.get_classy_state()
          )
  
          # train for one phase
          trainer.train(task)
          trainer.train(task_2)
  
          # task 2 should have the same state after training
          self._compare_states(
              task.get_classy_state(), task_2.get_classy_state()
          )
  
imports: import copy
  import itertools
  import shutil
  import tempfile
  import unittest
  import torch
  import torch.nn
  from classy_vision.dataset import build_dataset
  from classy_vision.generic.distributed_util import is_distributed_training_run
  from classy_vision.generic.util import get_checkpoint_dict, get_torch_version
  from classy_vision.hooks import CheckpointHook, LossLrMeterLoggingHook
  from classy_vision.losses import build_loss, ClassyLoss, register_loss
  from classy_vision.models import build_model, ClassyModel
  from classy_vision.optim import build_optimizer, SGD
  from classy_vision.tasks import build_task, ClassificationTask
  from classy_vision.trainer import LocalTrainer
  from test.generic.config_utils import get_fast_test_task_config, get_test_task_config
  from test.generic.utils import compare_model_state, compare_samples, compare_states, LimitedPhaseTrainer
label_desc: Use image node_id 11 for calling the TestClassificationTask obj's underlying member method code with example usage: obj.test_checkpointing() without return types