    def size(self, index):
        """Return an example's size as a float or tuple. This value is used when
        filtering a dataset with ``--max-positions``."""
        raise NotImplementedError
Return an example's size as a float or tuple. This value is used when
filtering a dataset with ``--max-positions``.
fairseq/data/fairseq_dataset.py