TransposeLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Reorders the axes of the input tensor according to a fixed permutation. Zero-parameter
utility layer, primarily used to expose a different axis as the “last” dimension so a
DenseLayer can operate on it (enables MLP-Mixer-style cross-axis MLPs
without bespoke kernels).
Inheritance: LayerBase<T> → TransposeLayer<T>
Implements: IShapeContract
How It Works
The permutation passed to the constructor uses logical axis indices
(excluding the batch axis). For rank-N inputs with a batch axis at position 0, this layer
keeps the batch axis at index 0 and permutes the remaining N-1 axes per
permutation.
Common pattern (MLP-Mixer temporal mixer):
Constructors
| Constructor | Summary |
|---|---|
TransposeLayer(int[] permutation) |
Initializes a new TransposeLayer. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
void ResetState() |