mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[DataPipe] Enable profiler record context in __next__ branch
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79757 Approved by: https://github.com/ejguan
This commit is contained in:
committed by
PyTorch MergeBot
parent
25ca006707
commit
e8ed16f3c0
@ -171,7 +171,8 @@ def hook_iterator(namespace, profile_name):
|
|||||||
@functools.wraps(next_func)
|
@functools.wraps(next_func)
|
||||||
def wrap_next(*args, **kwargs):
|
def wrap_next(*args, **kwargs):
|
||||||
if torch.autograd._profiler_enabled():
|
if torch.autograd._profiler_enabled():
|
||||||
return next_func(*args, **kwargs)
|
with profiler_record_fn_context():
|
||||||
|
return next_func(*args, **kwargs)
|
||||||
else:
|
else:
|
||||||
return next_func(*args, **kwargs)
|
return next_func(*args, **kwargs)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user