PredictionLoop¶
- class pytorch_lightning.loops.dataloader.PredictionLoop[source]¶
Bases:
abc.ABC
,Generic
[pytorch_lightning.loops.base.T
]Loop to run over dataloaders for prediction.
- on_run_end()[source]¶
Calls
on_predict_epoch_end
andon_predict_end
hooks and returns results from all dataloaders.
- property dataloaders: Sequence[torch.utils.data.dataloader.DataLoader]¶
Returns all prediction dataloaders.
- property max_batches: List[int]¶
The max number of batches this loop will run for each dataloader.
- property num_dataloaders: int¶
Returns the number of prediction dataloaders.
- property return_predictions: bool¶
Whether to return the predictions or not.
- property skip: bool¶
Determine whether to return immediately from the call to
run()
.Example:
@property def skip(self): return len(self.trainer.train_dataloader) == 0