Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Apr 21, 2021
1 parent 3b44a39 commit 792e3b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions pytorch_lightning/utilities/migration/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def default_migration(checkpoint):
return checkpoint


all_migrations = dict((ver, default_migration) for ver in version_history)


def get_version(checkpoint: dict) -> str:
return checkpoint["pytorch-lightning_version"]

Expand All @@ -121,9 +124,6 @@ def set_version(checkpoint: dict, version: str):
checkpoint["pytorch-lightning_version"] = version


all_migrations = dict((ver, default_migration) for ver in version_history)


class Migration:
""" Decorator for a function that upgrades a checkpoint from one version to the next. """

Expand Down
8 changes: 0 additions & 8 deletions pytorch_lightning/utilities/migration/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
from pytorch_lightning.utilities.migration.patch import pl_legacy_patch


@Migration(target="1.2.8")
def upgrade_callback_names(checkpoint: dict) -> dict:
if "callbacks" not in checkpoint:
return checkpoint
checkpoint["callbacks"] = reversed(checkpoint["callbacks"])
return checkpoint


@Migration(target="1.2.8")
def upgrade_something_else(checkpoint: dict) -> dict:
return checkpoint
Expand Down

0 comments on commit 792e3b3

Please sign in to comment.