mindspore.hal.max_memory_allocated ================================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/br_base/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/br_base/docs/api/api_python/hal/mindspore.hal.max_memory_allocated.rst :alt: 查看源文件 .. py:function:: mindspore.hal.max_memory_allocated(device_target=None) 返回从进程启动开始,内存池真实被Tensor占用的内存大小的峰值,此接口将在后续版本中废弃,请使用接口 :func:`mindspore.runtime.max_memory_allocated` 代替。 .. note:: - 对于 `CPU` 设备,固定返回0。 参数: - **device_target** (str,可选) - 目标设备,可选值为 ``"CPU"`` , ``"GPU"`` 以及 ``"Ascend"`` 。默认 ``None``,表示当前已经设置的设备。 返回: int,单位为Byte。