def test_advanced_profiler_describe(tmp_path, advanced_profiler):
    """Ensure the profiler won't fail when reporting the summary."""
    # record at least one event
    with advanced_profiler.profile("test"):
        pass
    # log to stdout and print to file
    advanced_profiler.describe()
    path = advanced_profiler.dirpath / f"{advanced_profiler.filename}.txt"
    data = path.read_text("utf-8")
    assert len(data) > 0
Ensure the profiler won't fail when reporting the summary.
tests/tests_pytorch/profilers/test_profiler.py