src/transformers/models/mobilebert/modeling_mobilebert.py/MobileBertForMaskedLM/resize_token_embeddings
class MobileBertForMaskedLM:    def resize_token_embeddings(self, new_num_tokens: Optional[int] = None) -> nn.Embedding:
        # resize dense output embedings at first
        self.cls.predictions.dense = self._get_resized_lm_head(
            self.cls.predictions.dense, new_num_tokens=new_num_tokens, transposed=True
        )
        return super().resize_token_embeddings(new_num_tokens=new_num_tokens)