code: def test_model_torch_save(tmpdir):
      """Test to ensure torch save does not fail for model and trainer."""
      model = BoringModel()
      num_epochs = 1
      trainer = Trainer(default_root_dir=tmpdir, max_epochs=num_epochs)
      temp_path = os.path.join(tmpdir, "temp.pt")
      trainer.fit(model)
  
      # Ensure these do not fail
      torch.save(trainer.model, temp_path)
      torch.save(trainer, temp_path)
      trainer = torch.load(temp_path)
  
file_path: pytorch-lightning/tests/tests_pytorch/checkpointing/test_torch_saving.py
imports: import os
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 for calling a global function with example usage: test_model_torch_save(tmpdir) without return types