MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / profiled_function

Function profiled_function

torch_utils/misc.py:100–105  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

98# Function decorator that calls torch.autograd.profiler.record_function().
99
100def profiled_function(fn):
101 def decorator(*args, **kwargs):
102 with torch.autograd.profiler.record_function(fn.__name__):
103 return fn(*args, **kwargs)
104 decorator.__name__ = fn.__name__
105 return decorator
106
107#----------------------------------------------------------------------------
108# Sampler for torch.utils.data.DataLoader that loops over the dataset

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected