8000 [DataPipe] Enable profiler record context in __next__ branch (#79757) · pytorch/pytorch@453a169 · GitHub
[go: up one dir, main page]

Skip to content

Commit 453a169

Browse files
NivekTfacebook-github-bot
authored andcommitted
[DataPipe] Enable profiler record context in __next__ branch (#79757)
Summary: Pull Request resolved: #79757 Approved by: https://github.com/ejguan Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/e8ed16f3c098290b52accfcc07ea668678ac2dab Reviewed By: malfet Differential Revision: D37258847 Pulled By: NivekT fbshipit-source-id: e011c12e522766f3f1234d5d00cfdd22aa72954b
1 parent d9d55c9 commit 453a169

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torch/utils/data/datapipes/_hook_iterator.py

Lines changed: 2 additions & 1 deletion
644B
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def wrap_generator(*args, **kwargs):
171171
@functools.wraps(next_func)
172172
def wrap_next(*args, **kwargs):
173173
if torch.autograd._profiler_enabled():
174-
return next_func(*args, **kwargs)
174+
with profiler_record_fn_context():
175+
return next_func(*args, **kwargs)
175176
else:
176177
return next_func(*args, **kwargs)
177178

0 commit comments

Comments
 (0)
0