Skip to content

Commit 545b38e

Browse files
authored
fix boolean argparse (#1571)
* fix boolean argparse #1570 * update change log
1 parent 7595570 commit 545b38e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
6262

6363
- Fixed a bug that caused the `callbacks` Trainer argument to reference a global variable ([#1534](https://github.com/PyTorchLightning/pytorch-lightning/pull/1534)).
6464

65+
- Fixed a bug that set all boolean CLI arguments from Trainer.add_argparse_args always to True ([#1570](https://github.com/PyTorchLightning/pytorch-lightning/issues/1570))
6566

6667
## [0.7.3] - 2020-04-09
6768

pytorch_lightning/trainer/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ def add_argparse_args(cls, parent_parser: ArgumentParser) -> ArgumentParser:
603603
for arg, arg_types, arg_default in (at for at in cls.get_init_arguments_and_types()
604604
if at[0] not in depr_arg_names):
605605
for allowed_type in (at for at in allowed_types if at in arg_types):
606-
if isinstance(allowed_type, bool):
606+
if allowed_type is bool:
607607
def allowed_type(x):
608608
return bool(distutils.util.strtobool(x))
609609
parser.add_argument(

0 commit comments

Comments
 (0)