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

Node

Graph vertex holding the reverse Jacobian vector product closure for an executed operation.

Node

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

Signature

rust
pub struct Node { id: NodeId, op_name: &'static str, backward_fn: Box<dyn BackwardFn>, parents: SmallVec<[NodeId; 2]> }

Overview

Graph vertex holding the reverse Jacobian vector product closure for an executed operation.

Invariants & Design Principles

  • Invariant: Stores weak references to parent nodes to prevent circular retention.

Usage Example

rust
let node = Node::new("matmul_backward", Box::new(MatmulBackward::new()));

Related Components