TargetDevice

TargetDevice

is an option for certain functions that specifies whether CPU or GPU computation should be attempted.

Details

  • Typically possible settings are "CPU" and "GPU".
  • TargetDevice can be used with NetTrain to determine on which device a network is trained.
  • TargetDevice can be supplied when applying a trained neural net to an input to determine on which device the network is evaluated.
  • With the setting TargetDevice->"GPU", the Wolfram Language will attempt to use a GPU if it is available on your computer.
  • TargetDevice{"GPU",n} allows a specific GPU to be used, where n is an integer between 1 and the number of GPUs available on your computer.

Examples

open allclose all

Basic Examples  (1)

Train a net on the system's default GPU:

In[1]:=
Click for copyable input
Out[1]=

Evaluate the resulting net on system's default GPU:

In[2]:=
Click for copyable input
Out[2]=

Scope  (1)

Possible Issues  (1)

See Also

NetTrain  Parallelize  NetEvaluationMode

Introduced in 2016
(11.0)