[癩竒]贾跌阑货戈綝ノ笰ひ籔矰
- paddle.device.cuda. empty_cache ( ) None [source]
-
百度 最后一节是属于詹姆斯的,他风骚的背后传球让JR命中三分,自己外线三分也中。
Releases idle cached memory held by the allocator so that those can be used in other GPU application and visible in nvidia-smi. In most cases you don’t need to use this function, Paddle does not release the memory back to the OS when you remove Tensors on the GPU, Because it keeps gpu memory in a pool so that next allocations can be done much faster.
Examples
>>> >>> import paddle >>> paddle.device.set_device('gpu') >>> tensor = paddle.randn([512, 512, 512], "float64") >>> del tensor >>> paddle.device.cuda.empty_cache()