mindspore/docs/api/api_python/ops/mindspore.ops.func_diagflat...

17 lines
593 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.ops.diagflat
======================
.. py:function:: mindspore.ops.diagflat(input, offset=0)
如果input是一维tensor则返回input作为对角线的二维tensor如果input是大于等于二维的tensor则将input展开后作为对角线的二维tensor。
参数:
- **input** (Tensor) - 输入tensor。
- **offset** (int, 可选) - 对角线偏移量。默认 ``0``
-`offset` 是正整数时,对角线向上方偏移。
-`offset` 是负整数时,对角线向下方偏移。
返回:
Tensor