seqLen property

int get seqLen

Length of the cached sequence so far (0 if empty). All KV heads share the same T, so we read from KV head 0.

Implementation

int get seqLen => k[0]?.shape[0] ?? 0;