def test_single_cpu():
    """Tests if device is set correctly for single CPU strategy."""
    trainer = Trainer(accelerator="cpu")
    assert isinstance(trainer.strategy, SingleDeviceStrategy)
    assert trainer.strategy.root_device == torch.device("cpu")
Tests if device is set correctly for single CPU strategy.
tests/tests_pytorch/strategies/test_single_device.py