code: def assert_equal_torch_models(model1, model2):
      # Check equality by comparing their `state_dict`
      model1_state = model1.state_dict()
      model2_state = model2.state_dict()
      assert len(model1_state.keys()) == len(model2_state.keys())
      for key in model1_state:
          assert key in model2_state
          assert torch.equal(model1_state[key], model2_state[key])
  
imports: import torch
  from ray.train.torch import TorchCheckpoint
label_desc: Use image node_id 1 for calling a global function with example usage: assert_equal_torch_models(model1, model2) without return types