    def compute_size(self):
        """
        Computes the size of the model (in MB).
        """

        res = 0
        for _, p in self.model.named_parameters():
            res += p.numel()
        return res * 4 / 1024 / 1024
Computes the size of the model (in MB).
fairseq/modules/quantization/pq/utils.py