Skip to main content

read_loop_signal

Function read_loop_signal 

Source
pub fn read_loop_signal(value: &Value) -> Option<LoopSignal>
Expand description

Read a termination signal out of a node’s output.

Recognized as stop: true, "done", "stop", {"done": true}, and Value::Empty (nothing left to produce). Recognized as continue: false, {"done": false}.

Returns None for anything else — including tensors. A body that only produces tensors cannot express termination, and the honest response is to say so rather than silently run to max_iterations.