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