TensorLearn
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.

python
import torch x = torch.tensor([1, 2, 3]) x = x.to("cuda") # Move to GPU

Operations

Identical to NumPy.

python
z = x + y z = torch.matmul(x, y)

Mark as Completed

TensorLearn - AI Engineering for Professionals