def test_advanced_profiler_cprofile_deepcopy(tmp_path):
    """Checks for pickle issue reported in #6522."""
    model = BoringModel()
    trainer = Trainer(
        default_root_dir=tmp_path,
        fast_dev_run=True,
        profiler="advanced",
        callbacks=StochasticWeightAveraging(swa_lrs=1e-2),
    )
    trainer.fit(model)
Checks for pickle issue reported in #6522.
tests/tests_pytorch/profilers/test_profiler.py