code: def test_from_model():
      model = torch.nn.Linear(1, 1)
      checkpoint = TorchCheckpoint.from_model(model)
      assert_equal_torch_models(checkpoint.get_model(), model)
  
      with checkpoint.as_directory() as path:
          checkpoint = TorchCheckpoint.from_directory(path)
          checkpoint_model = checkpoint.get_model()
  
      assert_equal_torch_models(checkpoint_model, model)
  
imports: import torch
  from ray.train.torch import TorchCheckpoint
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_model() without return types