fix deprecated default_save_path (#1449)

This commit is contained in:
Jirka Borovec 2020-04-10 20:32:56 +02:00 committed by GitHub
parent dcda5194df
commit d05ac813dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -89,6 +89,20 @@ class TrainerDeprecatedAPITillVer0_8(ABC):
" and this method will be removed in v0.8.0", DeprecationWarning)
self.num_sanity_val_steps = nb
@property
def default_save_path(self):
"""Back compatibility, will be removed in v0.8.0"""
rank_zero_warn("Attribute `default_save_path` has renamed to `default_root_dir` since v0.5.x"
" and this method will be removed in v0.8.0", DeprecationWarning)
return self.default_root_dir
@default_save_path.setter
def default_save_path(self, path):
"""Back compatibility, will be removed in v0.8.0"""
rank_zero_warn("Attribute `default_save_path` has renamed to `default_root_dir` since v0.5.x"
" and this method will be removed in v0.8.0", DeprecationWarning)
self.default_root_dir = path
class TrainerDeprecatedAPITillVer0_9(ABC):

View File

@ -34,6 +34,7 @@ def test_tbd_remove_in_v0_8_0_trainer():
'max_nb_epochs': 'max_epochs',
'min_nb_epochs': 'min_epochs',
'nb_sanity_val_steps': 'num_sanity_val_steps',
'default_save_path': 'default_root_dir',
}
# skip 0 since it may be interested as False
kwargs = {k: (i + 1) for i, k in enumerate(mapping_old_new)}