brainpy / BrainPy

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

Creat random key automatically when it is detected #461

Closed chaoming0625 closed 1 year ago

chaoming0625 commented 1 year ago

Every time when calling brainpy.math.clear_buffer_memory(), the random function in brainpy.math.random will not be available except when recalling brainpy.math.random.seed().

This PR fixes this problem and every time after the clear_buffer_memory is called, the random key of brainpy.math.random.DEFAULT will be regenerated automatically.