torch.profiler.Profiler.get_events
Profiler.get_events(): ProfilerEvent[]Returns all recorded profiling events.
Returns
ProfilerEvent[]– Array of all profiling events recorded during this profiling sessionExamples
const profiler = new Profiler();
profiler.start();
torch.tensor([1, 2, 3]).sum();
await profiler.stop();
const events = profiler.get_events();
console.log(events[0].name, events[0].duration, 'ms');