mindspore/docs/api/api_python/mint/mindspore.mint.func_eye.rst

15 lines
453 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.mint.eye
==================
.. 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