Skip to content

Commit

Permalink
Fixes print issues and data_loader (#1080)
Browse files Browse the repository at this point in the history
* print issue

* print issue

* print issue

* print issue

* print issue
  • Loading branch information
williamFalcon committed Mar 6, 2020
1 parent 3223e71 commit 21057d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions pytorch_lightning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
from .core import LightningModule
from .trainer import Trainer
from .callbacks import Callback
from .core import data_loader

__all__ = [
'Trainer',
'LightningModule',
'Callback',
'data_loader'
]
# __call__ = __all__
3 changes: 2 additions & 1 deletion pytorch_lightning/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def test_dataloader(self):
"""

from .decorators import data_loader
from .lightning import LightningModule

__all__ = ['LightningModule']
__all__ = ['LightningModule', 'data_loader']
# __call__ = __all__
8 changes: 1 addition & 7 deletions pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def forward(self, x):
"""
if self.trainer.proc_rank == 0:
log.info(*args, **kwargs)
print(*args, **kwargs)

@abstractmethod
def forward(self, *args, **kwargs):
Expand Down Expand Up @@ -1189,9 +1189,6 @@ def test_dataloader(self):
.. note:: If you don't need a test dataset and a test_step, you don't need to implement
this method.
.. note:: If you want to change the data during every epoch DON'T use the data_loader
decorator.
"""
return None

Expand Down Expand Up @@ -1257,9 +1254,6 @@ def val_dataloader(self):
.. note:: If you don't need a validation dataset and a validation_step, you don't need to
implement this method.
.. note:: If you want to change the data during every epoch DON'T use the data_loader
decorator.
.. note:: In the case where you return multiple `val_dataloaders`, the `validation_step`
will have an argument `dataset_idx` which matches the order here.
"""
Expand Down
3 changes: 2 additions & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,9 @@ def fit(
# feed to .fit()
"""
# bind logger
# bind logger and other properties
model.logger = self.logger
self.copy_trainer_model_properties(model)

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

0 comments on commit 21057d0

Please sign in to comment.