Clarify what gpus=0 means in docs (#2876)
* docs clarify what gpus=0 means * add example suggested by @ydcjeff
This commit is contained in:
parent
6ebe0d7266
commit
1bb268ad8a
|
@ -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>`_
|
||||
|
||||
|
|
Loading…
Reference in New Issue