mindspore.hal.empty_cache ========================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/hal/mindspore.hal.empty_cache.rst :alt: 查看源文件 .. py:function:: mindspore.hal.empty_cache() 清理内存池中的内存碎片,优化内存排布。 .. note:: - 接口即将废弃,请使用接口 :func:`mindspore.runtime.empty_cache` 代替。 - 目前MindSpore内存池没有清空内存碎片的功能,此为预留接口,实现为空方法。使用时,会通过日志方式提示。