Stonesjtu / pytorch_memlab

Profiling and inspecting memory in pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redirect report() to the file

Zeleni9 opened this issue · comments

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.

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

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.

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