code: def test_load_from_checkpoint_map_location_cpu(
      tmp_path, map_location
  ):
      create_boring_checkpoint(
          tmp_path, BoringModel(), accelerator="cpu"
      )
      model = BoringModel.load_from_checkpoint(
          f"{tmp_path}/checkpoint.ckpt", map_location=map_location
      )
      _ = BoringDataModule.load_from_checkpoint(
          f"{tmp_path}/checkpoint.ckpt", map_location=map_location
      )
      assert model.device.type == "cpu"
  
file_path: pytorch-lightning/tests/tests_pytorch/core/test_saving.py
imports: import lightning.pytorch
  import pytest
  import torch
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from tests_pytorch.conftest import mock_cuda_count, mock_mps_count
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 3 for calling a global function with example usage: test_load_from_checkpoint_map_location_cpu(tmp_path, map_location) without return types