Back to Course
Deep Learning with PyTorch
Module 1 of 12
1. Tensors & GPU
The Tensor
A NumPy array that can live on the GPU.
pythonimport torch x = torch.tensor([1, 2, 3]) x = x.to("cuda") # Move to GPU
Operations
Identical to NumPy.
pythonz = x + y z = torch.matmul(x, y)