Skip to content

Commit 006703d

Browse files
Alexander Snorkinrohitgr7
authored andcommitted
printing alongside progress bar added to LightningModule.print()
1 parent 4433921 commit 006703d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytorch_lightning/core/lightning.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ def forward(self, x):
170170
171171
"""
172172
if self.trainer.is_global_zero:
173-
print(*args, **kwargs)
173+
progress_bar = self.trainer.progress_bar_callback
174+
if progress_bar is not None and progress_bar.is_enabled:
175+
progress_bar.print(*args, **kwargs)
176+
else:
177+
print(*args, **kwargs)
174178

175179
def log(
176180
self,

0 commit comments

Comments
 (0)