参考链接:empty_cache-API文档-PaddlePaddle深度学习平台

import paddle

# required: gpu
paddle.set_device("gpu")
#tensor = paddle.randn([512, 512, 512], "float")
#del tensor
paddle.device.cuda.empty_cache()

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐