brainpy.math.clear_buffer_memory#

brainpy.math.clear_buffer_memory(platform=None)[source]#

Clear all on-device buffers.

This function will be very useful when you call models in a Python loop, because it can clear all cached arrays, and clear device memory.

Warning

This operation may cause errors when you use a deleted buffer. Therefore, regenerate data always.

Parameters

platform (str) – The device to clear its memory.