From d2989f76e6e1474d654f830017b69662b5060aca Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:08:34 -0400 Subject: [PATCH] ddp pickle --- pytorch_lightning/trainer/trainer.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index 59cdf41b42..deed00985e 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -614,19 +614,8 @@ class Trainer( return bool(parsing.strtobool(x)) if arg == 'gpus': - def allowed_type(x): - if ',' in x: - return str(x) - else: - return int(x) - - def arg_default_fx(x): - if ',' in x: - return str(x) - else: - return int(x) - - arg_default = arg_default_fx + allowed_type = Trainer.allowed_type + arg_default = Trainer.arg_default parser.add_argument( f'--{arg}', @@ -639,6 +628,18 @@ class Trainer( return parser + def allowed_type(x): + if ',' in x: + return str(x) + else: + return int(x) + + def arg_default(x): + if ',' in x: + return str(x) + else: + return int(x) + @classmethod def from_argparse_args(cls, args, **kwargs):