docsapi referencedarkforest-core-autograd-worklist
API Referencecrate: darkforest-coresince v0.1.0-alpha

Worklist

Topological sorting queue executing the iterative autograd graph in topological order.

Worklist

darkforest-core module: autograd since v0.1.0-alpha

Signature

rust
pub struct Worklist { queue: VecDeque<NodeId>, in_degree: HashMap<NodeId, usize> }

Overview

Topological sorting queue executing the iterative autograd graph in topological order.

Invariants & Design Principles

  • Invariant: Topological execution guarantees gradients are fully accumulated before executing backward on dependent nodes.

Usage Example

rust
let mut worklist = Worklist::from_root(loss_id);

Related Components