code: def compare_models(self, modelA, modelB, test_setup=""):
      state_dictA = modelA.state_dict()
      state_dictB = modelB.state_dict()
      self.assertEqual(
          len(state_dictA),
          len(state_dictB),
          "state_dicts have different lengths" + test_setup,
      )
      for key in state_dictA:
          paramA = state_dictA[key]
          paramB = state_dictB[key]
          self.assertTrue(
              (paramA == paramB).all(),
              msg="Parameters in state_dices not equal."
              + "key: {}\nparam: {}\nrestored: {}\ndiff: {} for {}".format(
                  key, paramA, paramB, paramA - paramB, test_setup
              ),
          )
  
imports: import unittest
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from apex import amp
  from utils import common_init, FLOAT
label_desc: Use image node_id 5 for calling the TestCheckpointing obj's underlying member method code with example usage: obj.compare_models(modelA, modelB, test_setup) without return types