Expand description
Sub-graph execution helper.
Op::If branches and Op::While body/cond are sub-graphs nested inside a parent graph. To execute them, the backend recursively compiles and runs the inner graph with bound inputs.
Strategy: compile the sub-graph lazily on first encounter, cache the
ExecutableGraph for repeated invocations (loops). A future
optimization: hoist the compile to the parent’s compile-time once
we have a stable IR for sub-graphs.
Structs§
- Subgraph
Cache - Lazily-compiled sub-graph cache. Keyed by sub-graph name (caller must ensure names are unique within the parent graph). Backend-agnostic: stores boxed ExecutableGraphs.