forked from Lightning-AI/pytorch-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: split tests-examples (Lightning-AI#990)
* CI: split tests-examples * tests without template * comment depends * CircleCI typo * add doctest * update test req. * CI tests * setup macOS * longer train * lover pred acc * fix model * rename default model * lower tests acc * typo * imports * fix test optimizer * update calls * fix Win * lower Drone image * fix call * pytorch image * fix test * add dev image * add dev image * update image * drone volume * lint * update test notes * rename tests/models >> tests/base * group models * conftest * optim imports * typos * fix import * fix tests * install AMP * tests * fix import
- Loading branch information
Showing
40 changed files
with
298 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# the default package dependencies | ||
|
||
tqdm>=4.41.0 | ||
numpy>=1.16.4 | ||
torch>=1.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ARG TORCH_VERSION=1.4 | ||
ARG CUDA_VERSION=10.1 | ||
|
||
FROM pytorch/pytorch:${TORCH_VERSION}-cuda${CUDA_VERSION}-cudnn7-runtime | ||
|
||
# Install AMP | ||
RUN bash ./tests/install_AMP.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""Models for testing.""" | ||
|
||
import torch | ||
|
||
from tests.base.models import TestModelBase, DictHparamsModel | ||
from tests.base.mixins import ( | ||
LightEmptyTestStep, | ||
LightValidationStepMixin, | ||
LightValidationMixin, | ||
LightValidationStepMultipleDataloadersMixin, | ||
LightValidationMultipleDataloadersMixin, | ||
LightTestStepMixin, | ||
LightTestMixin, | ||
LightTestStepMultipleDataloadersMixin, | ||
LightTestMultipleDataloadersMixin, | ||
LightTestFitSingleTestDataloadersMixin, | ||
LightTestFitMultipleTestDataloadersMixin, | ||
LightValStepFitSingleDataloaderMixin, | ||
LightValStepFitMultipleDataloadersMixin, | ||
LightTrainDataloader, | ||
LightTestDataloader, | ||
LightInfTrainDataloader, | ||
LightInfValDataloader, | ||
LightInfTestDataloader, | ||
LightTestOptimizerWithSchedulingMixin, | ||
LightTestMultipleOptimizersWithSchedulingMixin, | ||
LightTestOptimizersWithMixedSchedulingMixin, | ||
LightTestReduceLROnPlateauMixin | ||
) | ||
|
||
|
||
class LightningTestModel(LightTrainDataloader, | ||
LightValidationMixin, | ||
LightTestMixin, | ||
TestModelBase): | ||
"""Most common test case. Validation and test dataloaders.""" | ||
|
||
def on_training_metrics(self, logs): | ||
logs['some_tensor_to_test'] = torch.rand(1) | ||
|
||
|
||
class LightningTestModelWithoutHyperparametersArg(LightningTestModel): | ||
""" without hparams argument in constructor """ | ||
|
||
def __init__(self): | ||
import tests.base.utils as tutils | ||
|
||
# the user loads the hparams in some other way | ||
hparams = tutils.get_default_hparams() | ||
super().__init__(hparams) | ||
|
||
|
||
class LightningTestModelWithUnusedHyperparametersArg(LightningTestModelWithoutHyperparametersArg): | ||
""" has hparams argument in constructor but is not used """ | ||
|
||
def __init__(self, hparams): | ||
super().__init__() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.