Skip to content

Commit b730a5a

Browse files
authored
Do not describe when there's no summary (#6681)
1 parent bc61361 commit b730a5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytorch_lightning/profiler/profilers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ def describe(self) -> None:
148148
# so to avoid them, we open and close the files within this function
149149
# by calling `_prepare_streams` and `teardown`
150150
self._prepare_streams()
151-
self._write_stream(self.summary())
151+
summary = self.summary()
152+
if summary:
153+
self._write_stream(summary)
152154
if self._output_file is not None:
153155
self._output_file.flush()
154156
self.teardown(stage=self._stage)

0 commit comments

Comments
 (0)