8000 [DataPipe] Enable profiler record context in __next__ branch · pytorch/pytorch@e8ed16f · GitHub
[go: up one dir, main page]

Skip to content

Commit e8ed16f

Browse files
NivekTpytorchmergebot
authored andcommitted
[DataPipe] Enable profiler record context in __next__ branch
Pull Request resolved: #79757 Approved by: https://github.com/ejguan
1 parent 25ca006 commit e8ed16f

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
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