mindspore.runtime.memory_allocated
===================================

.. 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/runtime/mindspore.runtime.memory_allocated.rst
    :alt: 查看源文件


.. py:function:: mindspore.runtime.memory_allocated()

    返回当前实际被Tensor占用的内存大小。

    .. note::
        - 对于 `CPU` 硬件,固定返回0。

    返回:
        int,单位为Byte。