IShapeContract
Interfaces · AiDotNet.Interfaces
Declares, symbolically, how a layer or model sizes each of its output axes.
Known implementations: ABCLayer<T>, AConvBlock<T>, ADownBlock<T>, ALiBiPositionalBiasLayer<T>, AcousticConditionEncoderLayer<T>, ActNormFlowLayer<T>, ActivationLayer<T>, AdaptiveAveragePoolingLayer<T>, AddLayer<T>, AffineCouplingFlowLayer<T>, AnomalyDetectorLayer<T>, AttentionLayer<T>, AttentionalFeatureFusionLayer<T>, AttentiveTransformerLayer<T>, AudioNeuralNetworkBase<T>, AveragePoolingLayer<T>, BASEDLayer<T>, BartEncoderDecoderLayer<T>, BasicBlock<T>, BatchEnsembleLayer<T>, BatchNormalizationLayer<T>, BayesianDenseLayer<T>, BertEmbeddingLayer<T>, BiaffineSpanScorerLayer<T>, BiasFreeLinearLayer<T>, BidirectionalClozeNetworkLayer<T>, BidirectionalLayer<T>, BidirectionalRecurrentLayer<T>, BottleneckBlock<T>, BranchformerBlock<T>, C2PSABlock<T>, C2fBlock<T>, C3k2Block<T>, C3kBlock<T>, CSPBlock<T>, CSPBottleneckBlock<T>, CachedGroupedQueryAttention<T>, CachedMultiHeadAttention<T>, CapsuleLayer<T>, CausalTemporalAttention<T>, CbhgLayer<T>, CifAlignmentLayer<T>, CitrinetBlockLayer<T>, ClipVisionTransformerLayer<T>, ClozeAttentionLayer<T>, CohereDecoderBlock<T>, ColumnParallelLinear<T>, ConditionalLayerNormalizationLayer<T>, ConditionalRandomFieldLayer<T>, ConformerBlockLayer<T>, ConstantScaleLayer<T>, ContextNetBlockLayer<T>, ContinuumMemorySystemLayer<T>, Conv1DLayer<T>, Conv1DTransposeLayer<T>, Conv2DLayer<T>, Conv3DLayer<T>, Conv3DTransposeLayer<T>, ConvBatchNormStackLayer<T>, ConvLSTMLayer<T> (+330 more)
How It Works
Implement this on anything whose output extent depends on its configuration — every convolution, pooling, upsampling, patch-embedding and super-resolution type. With it, an output shape can be COMPUTED from an input shape without running a forward pass, which is what makes shape inference, chain validation and automatic test-fixture shapes possible rather than hand-maintained.
THE DECLARATION IS CHECKED, NOT TRUSTED. A conformance test resolves the declared relations and compares them against the shape the type’s real forward produces. A relation that drifts from the implementation fails there, which is the only thing that keeps a declaration worth reading — an unverified shape annotation is worse than none, because the next reader believes it.
Methods
| Method | Summary |
|---|---|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
One entry per output axis, in output order, for an input of the given rank. |