brainpy / BrainPy

Brain Dynamics Programming in Python
https://brainpy.readthedocs.io/
GNU General Public License v3.0
493 stars 90 forks source link

[dyn] add `clear_input` in the `step_run` function. #601

Closed chaoming0625 closed 5 months ago

chaoming0625 commented 5 months ago

Usually, we use step_run with brainpy.math.for_loop. This function does not call brainpy.clear_input, which may cause problems of input accumulation when using old APIs in brainpy.neurons module. Therefore, we should call brainpy.clear_input after each update function.