A saved graph contains the tensors and locally prepared VJPs from one forward execution. Its dense reference pass is exactly the existing full graph backpropagation, including intermediate seeds and nodes whose incoming cotangent is zero.
Locally saved node programs and their computed primal tensors in evaluation order.
- nil {α : Type} [TorchLean.Storage α] {Γ : List Spec.Shape} : SavedGraph α Γ []
- snoc {α : Type} [TorchLean.Storage α] {Γ ss : List Spec.Shape} {τ : Spec.Shape} (previous : SavedGraph α Γ ss) (prepared : PreparedNode α (Γ ++ ss) τ) (value : TorchLean.Tensor α τ) : SavedGraph α Γ (ss ++ [τ])
Instances For
Prepare a graph with one array context, saving only the inputs requested by each node.
Instances For
Checked preparation validates a node before evaluating or recording its primal.
Instances For
Successful checked preparation produces the same saved programs as pure preparation.
Prepared graph primals are the original graph evaluator's complete context.
The dense reference reverse pass preserves the original node and local addition order.
Instances For
Saved VJPs compute precisely full graph backpropagation for every seed pack.