Skip to content

Commit 21057d0

Browse files
Fixes print issues and data_loader (#1080)
* print issue * print issue * print issue * print issue * print issue
1 parent 3223e71 commit 21057d0

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

pytorch_lightning/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
from .core import LightningModule
2828
from .trainer import Trainer
2929
from .callbacks import Callback
30+
from .core import data_loader
3031

3132
__all__ = [
3233
'Trainer',
3334
'LightningModule',
3435
'Callback',
36+
'data_loader'
3537
]
3638
# __call__ = __all__

pytorch_lightning/core/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ def test_dataloader(self):
312312
313313
"""
314314

315+
from .decorators import data_loader
315316
from .lightning import LightningModule
316317

317-
__all__ = ['LightningModule']
318+
__all__ = ['LightningModule', 'data_loader']
318319
# __call__ = __all__

pytorch_lightning/core/lightning.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def forward(self, x):
8585
8686
"""
8787
if self.trainer.proc_rank == 0:
88-
log.info(*args, **kwargs)
88+
print(*args, **kwargs)
8989

9090
@abstractmethod
9191
def forward(self, *args, **kwargs):
@@ -1189,9 +1189,6 @@ def test_dataloader(self):
11891189
.. note:: If you don't need a test dataset and a test_step, you don't need to implement
11901190
this method.
11911191
1192-
.. note:: If you want to change the data during every epoch DON'T use the data_loader
1193-
decorator.
1194-
11951192
"""
11961193
return None
11971194

@@ -1257,9 +1254,6 @@ def val_dataloader(self):
12571254
.. note:: If you don't need a validation dataset and a validation_step, you don't need to
12581255
implement this method.
12591256
1260-
.. note:: If you want to change the data during every epoch DON'T use the data_loader
1261-
decorator.
1262-
12631257
.. note:: In the case where you return multiple `val_dataloaders`, the `validation_step`
12641258
will have an argument `dataset_idx` which matches the order here.
12651259
"""

pytorch_lightning/trainer/trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,9 @@ def fit(
558558
# feed to .fit()
559559
560560
"""
561-
# bind logger
561+
# bind logger and other properties
562562
model.logger = self.logger
563+
self.copy_trainer_model_properties(model)
563564

564565
# set up the passed in dataloaders (if needed)
565566
self.__attach_dataloaders(model, train_dataloader, val_dataloaders, test_dataloaders)

0 commit comments

Comments
 (0)