mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-08-30 11:29:56 +08:00
* new way of passing dataloaders * fixed docs * fixed codestyle to follow flake8 * allow val/test be list of dataloaders and smarter checking * added test * fix flake error * fix linking to new test model * split into multiple test * fix naming and typo * minor documentation changes * remove random file * Update trainer.py * Update trainer.py * Update trainer.py * Update trainer.py * Update trainer.py * Update trainer.py * better error/warning message * final adjustments * update CHANGELOG.md Co-authored-by: William Falcon <waf2107@columbia.edu>
25 lines
723 B
Python
25 lines
723 B
Python
"""Models for testing."""
|
|
|
|
import torch
|
|
|
|
from .base import LightningTestModelBase, LightningTestModelBaseWithoutDataloader
|
|
from .mixins import (
|
|
LightningValidationStepMixin,
|
|
LightningValidationMixin,
|
|
LightningValidationStepMultipleDataloadersMixin,
|
|
LightningValidationMultipleDataloadersMixin,
|
|
LightningTestStepMixin,
|
|
LightningTestMixin,
|
|
LightningTestStepMultipleDataloadersMixin,
|
|
LightningTestMultipleDataloadersMixin,
|
|
)
|
|
|
|
|
|
class LightningTestModel(LightningValidationMixin, LightningTestMixin, LightningTestModelBase):
|
|
"""
|
|
Most common test case. Validation and test dataloaders.
|
|
"""
|
|
|
|
def on_training_metrics(self, logs):
|
|
logs['some_tensor_to_test'] = torch.rand(1)
|