Clarify what gpus=0 means in docs (#2876)

* docs clarify what gpus=0 means

* add example suggested by @ydcjeff
This commit is contained in:
Adrian Wälchli 2020-08-08 17:50:08 +02:00 committed by GitHub
parent 6ebe0d7266
commit 1bb268ad8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -414,8 +414,8 @@ Under the hood the pseudocode looks like this:
gpus
^^^^
- Number of GPUs to train on
- or Which GPUs to train on
- Number of GPUs to train on (int)
- or which GPUs to train on (list)
- can handle strings
.. testcode::
@ -423,6 +423,9 @@ gpus
# default used by the Trainer (ie: train on CPU)
trainer = Trainer(gpus=None)
# equivalent
trainer = Trainer(gpus=0)
Example::
# int: train on 2 gpus
@ -440,6 +443,9 @@ Example::
# uses 8 gpus in total
trainer = Trainer(gpus=2, num_nodes=4)
# train only on GPUs 1 and 4 across nodes
trainer = Trainer(gpus=[1, 4], num_nodes=4)
See Also:
- `Multi-GPU training guide <multi_gpu.rst>`_