.ggmlr_batch_shards: Split a batch index range into (near) equal contiguous shards
Description
Helper: partition seq_len(M) into n contiguous blocks, as even as
possible (earlier shards get the +1 when M is not divisible by n).
Usage
.ggmlr_batch_shards(M, n)
Value
A list of integer vectors of row indices (1-based), length n;
empty vectors are dropped.
Arguments
- M
Number of rows (batch size).
- n
Number of shards.