Repeatedly executes body while cond returns TRUE, like R's
while loop. The loop state is initialized with init and
passed through each iteration.
Otherwise, no state is maintained between iterations.
Arguments
- init
(
named list())
Named list of initial state values.- cond
(
function)
Condition function that receives the current state as arguments and outputs whether to continue the loop.- body
(
function)
Body function that receives the current state as arguments and returns a named list with the same structure, dtypes, and shapes asinit.
Value
Named list with the same structure as init containing the
final state after the loop terminates.
StableHLO
Lowers to stablehlo::hlo_while().