    def num_tokens(self, index):
        """Return the number of tokens in a sample. This value is used to
        enforce ``--max-tokens`` during batching."""
        return self.sizes[index]
Return the number of tokens in a sample. This value is used to
enforce ``--max-tokens`` during batching.
fairseq/data/denoising_dataset.py