💡Use Cases
understanding how any autodiff framework implements backward, hand-writing autograd, and correctly implementing forward/backward for custom layers; interviews compare dynamic vs static graphs.
⚡Key Problems Solved
automatic differentiation removes manual/symbolic gradients — any differentiable program gets its gradient for free. Dynamic graphs (PyTorch eager) are built while executing, naturally support Python control flow, and are easy to debug, at the cost of per-step graph construction; static graphs (TF1 Graph mode) are built once and executed later, enabling global operator-fusion optimizations and smooth deployment, but are inflexible and hard to debug. Pitfalls: in-place ops break backward dependencies, so tensors that require grad forbid in-place modification; leaf tensors decide whether gradients are stored.