pub fn batch_indices<T>(batch_membership: &[T]) -> Vec<usize>where T: Hash + Eq + Clone,
Map arbitrary batch keys to 0..n_batches in order of first appearance.
0..n_batches