Stonesjtu / pytorch_memlab

Profiling and inspecting memory in pytorch
MIT License
1.01k stars 37 forks source link

Try to make a more illustrative example for LineProfiler #57

Closed wangkuiyi closed 1 month ago

wangkuiyi commented 2 months ago

I am trying to make the test an example that demonstrate the full features of line profiler in that

  1. LineProfiler accepts more than one functions to be profiled,
  2. Not every line of the code in the with block are profiled; instead, only function passed to LineProfile are.

Please see if this example is better than the previous one. If so, I'd like to keep improving the examples in future pull requests.