Flatten

Description

Flattens the input tensor into a 2D matrix. If the shape of the input tensor is (d_0, d_1, ...d_n), the output shape is (d_0 x d_1...d_axis-1, d_axis x...x dn).

Input

One input:

input: multi-dimensional tensor of type float16 or float.

Output

output: 2Dtensor with the content of the input tensor.

Attribute

axis: int (default value: 1) Specifies an input dimension (not included) that is tiled to the external dimension of the output. The value of axis must be within the range of [-r, r], where r is the rank of the input tensor. A negative value indicates that the size is calculated from the end. When axis=0, the shape of the output tensor is (1,(d_0 X d_1...d_n)), and the shape of the input tensor is (d_0,d_1, ...d_n).

ONNX Opset Support

Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18