brainpy.math.controls.while_loop#

brainpy.math.controls.while_loop(body_fun, cond_fun, dyn_vars, operands)[source]#

while-loop control flow with Variable.

New in version 2.1.11.

Parameters
  • body_fun (callable) – A function which define the updating logic. It receives one argument for operands, without returns.

  • cond_fun (callable) – A function which define the stop condition. It receives one argument for operands, with one boolean value return.

  • dyn_vars (Variable, sequence of Variable, dict) – The dynamically changed variables.

  • operands (Any) – The operands for body_fun and cond_fun functions.