    def num_tokens_vec(self, indices):
        """Return the number of tokens for a set of positions defined by indices.
        This value is used to enforce ``--max-tokens`` during batching."""
        return self.sizes[indices]
Return the number of tokens for a set of positions defined by indices.
This value is used to enforce ``--max-tokens`` during batching.
fairseq/data/monolingual_dataset.py