TF element-wise equals requires tf.equals() instead of == 
### System Info

```shell
Running in a Google Colab with GPU backend.
```


### Who can help?

@Narsil 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Running the 'fill-mask' pipeline:

```
import tensorflow.compat.v1 as tf
import tensorflow_datasets
import transformers
from transformers import pipeline, set_seed

# Load tokenizer and model from presaved locations:

tokenizer = transformers.GPT2Tokenizer.from_pretrained('/path/to/pretrained/GPT2/')
tokenizer.add_special_tokens({'pad_token': '[PAD]'})
model = transformers.TFGPT2LMHeadModel.from_pretrained('/path/to/pretrained/GPT2/')

# Create pipeline with this model and tokenizer:
unmasker = pipeline('fill-mask', model=model, tokenizer=tokenizer)
print(unmasker("Hello I'm a [MASK] model"))
```

This produces the following error: 

`{{function_node __wrapped__Where_device_/job:localhost/replica:0/task:0/device:GPU:0}} WhereOp: Unhandled input dimensions: 0 [Op:Where] `

My best guess is that this is because of line 56 of fill_mask.py:

`masked_index = tf.where(input_ids == self.tokenizer.mask_token_id).numpy()`

TF requires `tf.equals(tensor1, tensor2)` instead of `==`. This bug may occur elsewhere as well -- I haven't checked exhaustively. 


### Expected behavior

```shell
A dictionary object with the keys `sequence`, `score`, and `token` is printed.
```

Hi @ekayen 👋 

`self.tokenizer.mask_token_id` (on [L56 in fill_mask.py](https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/fill_mask.py#L56)) should be a single integer, and `tf.where(tensor == integer)` works well in TF1 and TF2 (see the examples below)

```python
import tensorflow as tf
a = tf.range(10)
b = tf.where(a == 5)
print(b)
```

```python
import tensorflow.compat.v1 as tf
a = tf.range(10)
b = tf.where(a == 5)
print(b)
```

From the error message, we can read "... Unhandled input dimensions: 0". Can you confirm that your tokenizer has `tokenizer.mask_token_id` set? That would be my biggest suspicion :)

P.S.:
1 - `transformers` does not support TF1 behavior -- it is possible that things break, and we won't be able to provide help in that situation :( I'd highly recommend updating your project to TF2, if you have the resources to do so.
2 - Our bandwidth as maintainers of a large project is very limited. When opening an issue, if you can provide an example that can run on any machine (and that does not depend on local files), the odds of getting a useful response are much higher 🙌 
<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.