(fn)
| 96 | # Function decorator that calls torch.autograd.profiler.record_function(). |
| 97 | |
| 98 | def profiled_function(fn): |
| 99 | def decorator(*args, **kwargs): |
| 100 | with torch.autograd.profiler.record_function(fn.__name__): |
| 101 | return fn(*args, **kwargs) |
| 102 | decorator.__name__ = fn.__name__ |
| 103 | return decorator |
| 104 | |
| 105 | #---------------------------------------------------------------------------- |
| 106 | # Sampler for torch.utils.data.DataLoader that loops over the dataset |
nothing calls this directly
no outgoing calls
no test coverage detected