We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 707f1c0 commit 660c269Copy full SHA for 660c269
tests/tests_pytorch/profilers/test_profiler.py
@@ -336,6 +336,12 @@ def test_advanced_profiler_deepcopy(advanced_profiler):
336
assert deepcopy(advanced_profiler)
337
338
339
+def test_advanced_profiler_nested(advanced_profiler):
340
+ """Ensure AdvancedProfiler does not raise ValueError for nested profiling actions (Python 3.12+ compatibility)."""
341
+ with advanced_profiler.profile("outer"), advanced_profiler.profile("inner"):
342
+ pass # Should not raise ValueError
343
+
344
345
@pytest.fixture
346
def pytorch_profiler(tmp_path):
347
return PyTorchProfiler(dirpath=tmp_path, filename="profiler")
0 commit comments