ReshapeLayer
ReshapeLayer[dims]
represents a net layer that reinterprets the input to be an array of dimensions dims.
Details and Options
- The total number of elements in the input array must equal the total number of elements in the output array.
- ReshapeLayer[…][input] explicitly computes the output from applying the layer to input.
- ReshapeLayer[…][{input1,input2,…}] explicitly computes outputs for each of the inputi.
- ReshapeLayer exposes the following ports for use in NetGraph etc.:
-
"Input" a tensor of arbitrary rank "Output" a tensor of dimension dims - ReshapeLayer is typically used inside NetChain, NetGraph, etc.
- ReshapeLayer normally infers the dimensions of its input from its context in NetChain etc. To specify the dimensions explicitly as {n1,n2,…}, use ReshapeLayer["Input"->{n1,n2,…}].
Examples
open allclose allBasic Examples (2)
Create a ReshapeLayer that reshapes any input into a 2×3 matrix:
Create a ReshapeLayer that reshapes any input into a 2×3 matrix:
Scope (4)
Properties & Relations (2)
Possible Issues (1)
Interactive Examples (1)
Neat Examples (2)
See Also
FlattenLayer ReplicateLayer ResizeLayer TransposeLayer PartLayer ArrayReshape NetChain NetGraph
Related Guides
Introduced in 2016
(11.0)