[Profiler] Memory profiler part 12: Emit timeline of memory events. (#89355)
Add a simple interface to get a flat representation of the memory profile.
Differential Revision: [D40868663](https://our.internmc.facebook.com/intern/diff/D40868663/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89355
Approved by: https://github.com/chaekit