Build the core of PyTorch in 80 lines
one move: propagate responsibility
Open the code pane immediately, then use the Spec tab, optional design question, tests, and artifact when you want them.
Finish each move before carrying the artifact forward.
A scalar Value can remember parents and local derivative rules, then replay them backward.
Deliverable: Write the mechanism in one sentence.Implement a scalar computation graph with add, multiply, power, and backward traversal.
Deliverable: Type the smallest runnable implementation.Finite differences must agree with accumulated gradients, including branches.
Deliverable: Record the expected output and one edge case.Train a tiny neuron on the new engine and compare it to the hand-written version.
Deliverable: Change one variable and explain the result.A tested scalar autograd engine with a gradient graph.
Deliverable: Save the code, output, and a short failure note.Finite differences must agree with accumulated gradients, including branches.
Train a tiny neuron on the new engine and compare it to the hand-written version.
A tested scalar autograd engine with a gradient graph.
Mapped from the supplied Build Everything PDF, source page 45. The five moves are Deriva’s implementation contract for this project.