December 2018
Intermediate to advanced
158 pages
3h 58m
English
The simplest way to make a model run faster is to add GPUs. A significant reduction in training time can be achieved by transferring processor-intensive tasks from the central processing unit (CPU) to one or more GPUs. PyTorch uses the torch.cuda() module to interface with the GPUs. CUDA is a parallel computing model created by NVIDIA that features lazy assignment so that resources are only allocated when needed. The resulting efficiency gains are substantial.
PyTorch uses a context manager, torch.device(), to assign tensors to a particular device. The following screenshot shows an example of this:

It is a more usual practice to ...
Read now
Unlock full access