Skip to content

Commit

Permalink
set tpu_id to None if int
Browse files Browse the repository at this point in the history
  • Loading branch information
lezwon committed May 6, 2020
1 parent 725ef5d commit c0a4f9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ def __init__(
self.tpu_cores = tpu_cores
assert tpu_cores in [1, 8, None] or len(tpu_cores) == 1, 'tpu_cores can only be 1, 8 or [<1-8>]'

if isinstance(tpu_cores, list):
self.tpu_id = tpu_cores[0]
self.tpu_id = tpu_cores[0] if isinstance(tpu_cores, list) else None

if num_processes != 1 and distributed_backend != "ddp_cpu":
rank_zero_warn("num_processes is only used for distributed_backend=\"ddp_cpu\". Ignoring it.")
Expand Down

0 comments on commit c0a4f9d

Please sign in to comment.