    def __len__(self):
        """Save reads by caching len"""
        if self._n is None:
            self._n = len(self.array)
        return self._n
Save reads by caching len
fairseq/data/plasma_utils.py