problem when calling resize_token_embeddings
When calling resize_token_embeddings, the model actually only modifies its embedding and decoder weight, whlie the decoder bias is unchanged. So whenever the forward function is called, the following error will be raised.
```python
RuntimeError: The size of tensor a (21215) must match the size of tensor b (21128) at non-singleton dimension 2
```
Which model were you resizing?<|||||>I'm working on chinese BertForPreTraining model<|||||>This is strange because Bert's LM head has no bias...

Would need to have a more complete error message to be able to understand.<|||||>```python
class BertLMPredictionHead(nn.Module):
    def __init__(self, config):
        super(BertLMPredictionHead, self).__init__()
        self.transform = BertPredictionHeadTransform(config)

        # The output weights are the same as the input embeddings, but there is
        # an output-only bias for each token.
        self.decoder = nn.Linear(config.hidden_size,
                                 config.vocab_size,
                                 bias=False)

        self.bias = nn.Parameter(torch.zeros(config.vocab_size))

    def forward(self, hidden_states):
        hidden_states = self.transform(hidden_states)
        hidden_states = self.decoder(hidden_states) + self.bias
        return hidden_states
```
```python
self.bias = nn.Parameter(torch.zeros(config.vocab_size))
```
For example, we load the pretrained model whose vocab size is 23189, and i add 1000 tokens and call resize_token_embeddings. Since the decoder weight is actually embedding weight, they are reshaped to (24189, hidden_size), but the bias is still 23189.<|||||>This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
