Fix attribute error for _gpus_arg_default loading checkpoint prior to 1.2.8 (#7043)
This commit is contained in:
parent
24248d6dd4
commit
67528c4665
|
@ -286,6 +286,13 @@ def _gpus_allowed_type(x) -> Union[int, str]:
|
|||
return int(x)
|
||||
|
||||
|
||||
def _gpus_arg_default(x) -> Union[int, str]: # pragma: no-cover
|
||||
# unused, but here for backward compatibility with old checkpoints that need to be able to
|
||||
# unpickle the function from the checkpoint, as it was not filtered out in versions < 1.2.8
|
||||
# see: https://github.com/PyTorchLightning/pytorch-lightning/pull/6898
|
||||
pass
|
||||
|
||||
|
||||
def _int_or_float_type(x) -> Union[int, float]:
|
||||
if '.' in str(x):
|
||||
return float(x)
|
||||
|
|
Loading…
Reference in New Issue