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

22 lines
783 B
ReStructuredText
Raw 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(x, offset=0)
创建一个二维Tensor用展开后的 `x` 作为它的对角线。
参数:
- **x** (Tensor) - 输入Tensor展开后作为输出的对角线。
- **offset** (int, 可选) - `offset` 控制选择哪条对角线。默认值0。
-`offset` 是0时选择的对角线是主对角线。
-`offset` 是正整数时,选择的对角线在主对角线上。
-`offset` 是负整数时,选择的对角线在主对角线下。
返回:
二维Tensor对角线是展开的 `x`
异常:
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `offset` 不是整数。