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.

TransposeLayer[{n1,n2,}]

represents a net layer such that the k^(th) level of the input is the nk^(th) level in the output.

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  (6)

Arguments  (1)

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:

Ports  (5)

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:

Create a TransposeLayer that swaps axes with given permutations:

Create a TransposeLayer with partially specified input size that swaps axes with given permutations:

Possible Issues  (2)

TransposeLayer cannot accept symbolic inputs:

TransposeLayer may not be able to process arrays with ranks higher than 5:

The computation can be performed if the number of transpositions needed is small enough:

Wolfram Research (2017), TransposeLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/TransposeLayer.html (updated 2021).

Text

Wolfram Research (2017), TransposeLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/TransposeLayer.html (updated 2021).

CMS

Wolfram Language. 2017. "TransposeLayer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/TransposeLayer.html.

APA

Wolfram Language. (2017). TransposeLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TransposeLayer.html

BibTeX

@misc{reference.wolfram_2023_transposelayer, author="Wolfram Research", title="{TransposeLayer}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/TransposeLayer.html}", note=[Accessed: 28-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_transposelayer, organization={Wolfram Research}, title={TransposeLayer}, year={2021}, url={https://reference.wolfram.com/language/ref/TransposeLayer.html}, note=[Accessed: 28-March-2024 ]}