Expand description
Reserved keys in a run’s output store.
A run threads node outputs through one HashMap<String, Value>, and a
few entries in it are not node outputs: the graph’s input, a specific
node’s input, and the state a trainable node learned. They are
distinguished by a __ prefix.
The prefixes used to be spelled inline — written with format! in the
runner and read back with strip_prefix in three different crates. This
module is the only place that knows how the key is spelled, so a change
to it cannot leave one reader behind.
The prefix is a convention, not a guarantee: a node whose id is literally
__state_x would collide. is_reserved is what a caller uses to keep
these out of a list of node outputs.
Constants§
- GRAPH_
INPUT - The graph’s own input, available to every root node.
Functions§
- input_
key - Where the input handed to
node_idis stored. - is_
input_ key - Does this key hold an input rather than an output or a state?
- is_
reserved - Is this key one of the run’s own entries rather than a node’s output?
- node_
of_ state_ key - The node whose state this key holds, or
Noneif it is not a state key. - state_
key - Where the state fitted for
node_idis stored.