def test_cpu_model(tmp_path):
    """Make sure model trains on CPU."""
    seed_everything(42)
    trainer_options = {
        "default_root_dir": tmp_path,
        "enable_progress_bar": False,
        "max_epochs": 1,
        "limit_train_batches": 4,
        "limit_val_batches": 4,
    }

    model = BoringModel()
    tpipes.run_model_test(trainer_options, model)
Make sure model trains on CPU.
tests/tests_pytorch/models/test_cpu.py