(fn)
| 109 | # Function decorator that calls torch.autograd.profiler.record_function(). |
| 110 | |
| 111 | def 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 |
nothing calls this directly
no outgoing calls
no test coverage detected