0PricingLogin
Deep Learning Academy · Lesson

requires_grad and the Computation Graph

Track operations to differentiate them.

Calculus, Handled For You

Training needs derivatives, but you never compute them by hand. PyTorch's autograd watches your math and works out every gradient for you. 🤖

Tensors Can Track Themselves

A tensor only earns gradients when you ask. Set requires_grad to true and PyTorch starts recording every operation done to it.

x = torch.tensor(2.0, requires_grad=True)

All lessons in this course

  1. requires_grad and the Computation Graph
  2. Call backward() to Get Gradients
  3. Reading and Zeroing .grad
  4. torch.no_grad() for Inference
← Back to Deep Learning Academy