Stonesjtu / pytorch_memlab

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

Redirect report() to the file #23

Closed Zeleni9 closed 3 years ago

Zeleni9 commented 3 years ago

Hi, thank you for very useful python library. I am just checking if there is a way to redirect report() output directly to the txt file without redirecting stdout or anything similar. Or add method that returns string fo report, something like reporter.report() -> str.

Stonesjtu commented 3 years ago

It would be a nice feature. Can you provide the detailed use-cases when redirecting report() helps?

Zeleni9 commented 3 years ago

A simple example could be creating report of the models when using ML Flow for logging all the data about each run. When using ML Flow it is pretty impossible to get stdout saved, so everything should be saved into txt files and then saved inside the ML Flow dashboard.

Stonesjtu commented 3 years ago

Looks like we should implement a str method so you can simply logging.info(reporter)