mindspore2022/docs/api/api_python/ops/mindspore.ops.Flatten.rst

19 lines
531 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.Flatten
======================
.. py:class:: mindspore.ops.Flatten
扁平化Flatten输入Tensor不改变0轴的size。
**输入:**
- **input_x** (Tensor) - 待扁平化的Tensor其shape为 :math:`(N, \ldots)` :math:`N` 表示batch size。
**输出:**
Tensor输出shape为 :math:`(N, X)` 的Tensor其中 :math:`X` 是余下维度的乘积。
**异常:**
- **TypeError** - `input_x` 不是Tensor。
- **ValueError** - `input_x` 的shape长度小于1。