PythonDeep learningAutograd
Why I built it
To strip away the magic of PyTorch's loss.backward() and understand what
an autograd engine really does. minute-grad is small enough to read in an
afternoon — under a thousand lines — and demonstrates reverse-mode
autodiff on a real tensor type with broadcasting.
What it does
Tensors track their parent operations as a DAG. Each op records a backward function that, given an upstream gradient, computes gradients for its inputs. A topological traversal from the loss tensor walks those backward functions in order, accumulating gradients into leaf nodes.
It supports enough ops to train a small MLP on MNIST end-to-end on CPU.