diff --git a/pytorch_lightning/utilities/argparse.py b/pytorch_lightning/utilities/argparse.py index 5f7c280db8..6dbc4636b9 100644 --- a/pytorch_lightning/utilities/argparse.py +++ b/pytorch_lightning/utilities/argparse.py @@ -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)