TransposeLayer

TransposeLayer[]

represents a net layer that transposes the first two levels of its input.

TransposeLayer[mn]

represents a net layer that transposes levels m and n of its input.

TransposeLayer[{m1n1,m2n2,}]

represents a net layer that sequentially transposes levels mi and ni of its input.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Create a TransposeLayer:

Create a TransposeLayer that takes a matrix as input:

Apply the layer to input:

Scope  (4)

Create a TransposeLayer that transposes the first and third dimensions of an input array:

Apply the layer to a 1×2×3 array to produce a 3×2×1 array:

Create a TransposeLayer that takes a matrix as input:

The layer threads across a batch of examples:

Create a TransposeLayer that swap axis 1 with axis 3 and axis 2 with axis 4:

Apply the layer to a 3×4×5×6 array to produce a 5×6×3×4 array:

Create a TransposeLayer that swaps axes 1 and 3 and subsequently swaps axes 1 and 4:

Apply the layer to a 3×4×5×6 array to produce a 6×4×3×5 array:

Possible Issues  (1)

TransposeLayer cannot accept symbolic inputs:

Introduced in 2017
 (11.1)
 |
Updated in 2019
 (12.0)