MCPcopy Create free account
hub / github.com/SwayStar123/SpeedrunDiT / profiled_function

Function profiled_function

preprocessing/torch_utils/misc.py:111–116  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

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