mindspore/docs/api/api_python/nn/mindspore.nn.Flatten.rst

16 lines
618 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.nn.Flatten
====================
.. py:class:: mindspore.nn.Flatten
对输入Tensor的第零维之外的维度进行展平操作。
输入:
- **x** (Tensor) - 要展平的输入Tensor。数据类型为 `number <https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore/mindspore.dtype.html#mindspore.dtype>`_。shape为 :math:`(N, *)` ,其中 :math:`*` 表示任意的附加维度。
输出:
Tensorshape为 :math:`(N, X)`,其中 :math:`X` 是输入 `x` 的shape除N之外的其余维度的乘积。
异常:
- **TypeError** - `x` 不是Tensor。