src/transformers/trainer_pt_utils.py/ShardSampler/__len__
class ShardSampler:    def __len__(self):
        # Each shard only sees a fraction of total_num_samples.
        return self.total_num_samples // self.num_processes