Skip to content

Glossary: Calculus for ML

requires_grad

Also written: .grad, .backward(), zero_grad

A PyTorch flag telling it to record operations on a tensor so gradients can be computed. After `backward()`, each gradient is in `.grad`, and new gradients are added to old ones unless you clear them.

Where the book teaches it

Related terms

PyTorchTensorOptimizer