Add attention-mask support for ViTModel
# What does this PR do?

Transformers currently only support head-masks, however recent works
in vision language modeling have used the ViTModel with attention-masks.
Adding attention-masks to ViTSelfAttention and ViTModel allow
transformers modeling_vit to be used in implementing these models.

This commit adds attention-mask implementations from BertSelfAttention
as the forward param attention_mask. This change preserves the existing
behavior by default.

A specific example of how this change will be useful is being able to
implement ViLT https://arxiv.org/abs/2102.03334, using ViTModel as the main trunk.

Unit-tests seemed to pass, though there wasn't a unit-test for head_masks,
so I just added a check for attention_mask in the signature.
Thanks!


src/transformers/models/vit/modeling_vit.py @LysandreJik, @sgugger 

@NielsRogge reordered params!<|||||>Thanks. I think this should also be added for the Flax implementation of ViT, for consistency.

It could perhaps also be added for BEiT.<|||||>@NielsRogge added to flax_vit, beit, and flax_beit.<|||||>Thanks. Can you also edit the corresponding tests? In `test_modeling_vit.py` (and similarly, in test_modeling_deit.py, test_modeling_beit.py and the flax models), we can add the `attention_mask` to the `prepare_config_and_inputs` method, such that the `attention_mask` is also used in all tests.<|||||>@Ryan-Qiyu-Jiang the shape of the `attention_mask` provided to these models is equal to (batch_size, seq_len), with the sequence length equal to the number of patches + 1 for the [CLS] token (and + 2 for DeiT, as this model also adds a special distillation token to the sequence).

This should also be added to the docstrings of the respective models. <|||||>Hi @Ryan-Qiyu-Jiang, after working on another PR (#13874), I now wonder what the use is of an `attention_mask` being defined for vision models. Is this for the case where images in a batch are padded, and one doesn't want to take into account the `attention_scores` for padding pixels?<|||||>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/master/CONTRIBUTING.md) are likely to be ignored.