mindspore.mint.eye
==================

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


.. py:function:: mindspore.mint.eye(n, m=None, dtype=None)

    返回一个主对角线上元素为1,其余元素为0的tensor。

    参数:
        - **n** (int) - 返回的行数。
        - **m** (int,可选) - 返回的列数。如果为None,与n相等。默认 ``None`` 。
        - **dtype** (mindspore.dtype,可选) - 返回的数据类型。默认 ``None`` 。

    返回:
        Tensor