Skip to content

Commit

Permalink
Do not describe when there's no summary (#6681)
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Mar 26, 2021
1 parent bc61361 commit b730a5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytorch_lightning/profiler/profilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def describe(self) -> None:
# so to avoid them, we open and close the files within this function
# by calling `_prepare_streams` and `teardown`
self._prepare_streams()
self._write_stream(self.summary())
summary = self.summary()
if summary:
self._write_stream(summary)
if self._output_file is not None:
self._output_file.flush()
self.teardown(stage=self._stage)
Expand Down

0 comments on commit b730a5a

Please sign in to comment.