ICollateFunction<TSample, TBatch>

Interfaces · AiDotNet.Data.Collation

Defines how individual samples are assembled into a batch.

Known implementations: DefaultCollateFunction<T>, PackedSequenceCollateFunction<T>, PaddingCollateFunction<T>, SequencePackingCollateFunction<T>

How It Works

Collate functions control how variable-length or heterogeneous samples are combined into a single batch tensor. This is critical for NLP and sequence models where inputs have different lengths.

Methods

Method Summary
TBatch Collate(IReadOnlyList<TSample> samples) Assembles a collection of individual samples into a batch.