mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
Allow Trainer's gpus arg type to be subclass of currently accepted types (#1423)
* Fixed Trainer `gpus` arg type issue Fixes #1388 * Disallow boolean gpus parameter Co-Authored-By: Adrian Wälchli <aedu.waelchli@gmail.com> * Fixed missing paranthesis Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
This commit is contained in:
co-authored by
Adrian Wälchli
parent
1ee2837d62
commit
a22a8142ac
@@ -566,7 +566,7 @@ def check_gpus_data_type(gpus):
|
||||
:return: return unmodified gpus variable
|
||||
"""
|
||||
|
||||
if gpus is not None and type(gpus) not in (int, str, list):
|
||||
if gpus is not None and (not isinstance(gpus, (int, str, list)) or isinstance(gpus, bool)):
|
||||
raise MisconfigurationException("GPUs must be int, string or list of ints or None.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user