MCPcopy Create free account
hub / github.com/SizheAn/PanoHead / profiled_function

Function profiled_function

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

Source from the content-addressed store, hash-verified

100# Function decorator that calls torch.autograd.profiler.record_function().
101
102def profiled_function(fn):
103 def decorator(*args, **kwargs):
104 with torch.autograd.profiler.record_function(fn.__name__):
105 return fn(*args, **kwargs)
106 decorator.__name__ = fn.__name__
107 return decorator
108
109#----------------------------------------------------------------------------
110# 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