MCPcopy Create free account
hub / github.com/apple/ml-vivid / profiled_function

Function profiled_function

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

Source from the content-addressed store, hash-verified

113# Function decorator that calls torch.autograd.profiler.record_function().
114
115def profiled_function(fn):
116 def decorator(*args, **kwargs):
117 with torch.autograd.profiler.record_function(fn.__name__):
118 return fn(*args, **kwargs)
119 decorator.__name__ = fn.__name__
120 return decorator
121
122#----------------------------------------------------------------------------
123# 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