2021-12-07 12:17:56 +08:00
|
|
|
|
mindspore.nn.Flatten
|
|
|
|
|
|
====================
|
|
|
|
|
|
|
|
|
|
|
|
.. py:class:: mindspore.nn.Flatten
|
|
|
|
|
|
|
2021-12-20 15:33:20 +08:00
|
|
|
|
对输入Tensor的第0维之外的维度进行展平操作。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**输入:**
|
|
|
|
|
|
|
2022-04-08 09:41:47 +08:00
|
|
|
|
- **x** (Tensor) - 要展平的输入Tensor。shape为 :math:`(N, *)`,其中 :math:`*` 表示任意的附加维度。数据类型为 `number <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore.html#mindspore.dtype>`_。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**输出:**
|
|
|
|
|
|
|
2021-12-20 15:33:20 +08:00
|
|
|
|
Tensor,shape为 :math:`(N, X)`,其中 :math:`X` 是输入 `x` 的shape除N之外的其余维度的乘积。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**异常:**
|
|
|
|
|
|
|
|
|
|
|
|
**TypeError** - `x` 不是Tensor。
|