Method Flatten
Flatten(int)
Creates a TensorShape by duplicating this and reshaping to a 2D matrix. The dimensions before axis are collapsed into the outer dimension and the remaining axes are collapsed into the inner dimension.
For example, if this is (2, 3, 4), and the value of axis is 2, the method returns (2 * 3, 4).
Declaration
public TensorShape Flatten(int axis = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| int | axis | The axis at which to flatten. |
Returns
| Type | Description |
|---|---|
| TensorShape | The flattened tensor shape. |