Skip to content

Commit df7b6d9

Browse files
mparientewilliamFalcon
authored andcommitted
Correct behavior for argument gpus in Trainer (#561)
1 parent db0587f commit df7b6d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/trainer/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(self,
132132
self.gradient_clip_val = gradient_clip_val
133133
self.check_val_every_n_epoch = check_val_every_n_epoch
134134
self.track_grad_norm = track_grad_norm
135-
self.on_gpu = gpus is not None and torch.cuda.is_available()
135+
self.on_gpu = True if (gpus and torch.cuda.is_available()) else False
136136
self.process_position = process_position
137137
self.weights_summary = weights_summary
138138
self.max_nb_epochs = max_nb_epochs

0 commit comments

Comments
 (0)