Skip to main content

seq_len_distribution

Function seq_len_distribution 

Source
pub(super) fn seq_len_distribution(lens: &[usize]) -> SeqLenDistribution
Expand description

Computes min, max, mean, and p95 token-length statistics for an embed batch.

Returns a zeroed SeqLenDistribution for an empty slice. Allocates a temporary sorted copy of lens; batch sizes are ≤ 256 so this is cheap.