Add Swin Transformer
# What does this PR do?

This PR adds the Swin Transformer model to the repository.

Paper: [https://arxiv.org/abs/2103.14030](https://arxiv.org/abs/2103.14030)
Code: [Official code](https://github.com/microsoft/Swin-Transformer) and [timm implementation](https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/swin_transformer.py)
Checkpoints: [Image classification](https://github.com/microsoft/Swin-Transformer)

Fixes #14760 

My code is modeled after the ViT implementation. There are a few tasks to do:

- [x] Fix `TypeError: Object of type type is not JSON serializable` when saving `SwinConfig`
- [x] Fix tests in test_modeling_swin.py

## Who can review?

@NielsRogge 
Thanks for your review. I overlooked the fact the reviewer is made a co-author by GitHub. I'll keep that in mind going forward.<|||||>> I overlooked the fact the reviewer is made a co-author by GitHub. I'll keep that in mind going forward.

I'm pretty sure you didn't know, which is why I'm telling you :-)<|||||>Hi, could you please also add swin transformer for semantic segmentation? Right now, I saw it's only for image classification. Thank you.<|||||>Hi @vaneshieh, I am not sure if Swin for sematic segmentation would be feasible. This would require incorporation of other models such as UPerNet into huggingface, which may reequire a lot of extra work.<|||||>Hi, `SwinForSemanticSegmentation` should be relatively easy to add since it uses the same head (UperNet) as `BeitForSemanticSegmentation`, which I already added. Hence, it would mostly be a copy-paste, the only thing to write is the conversion script.<|||||>Oh, I wasn't aware of that. I can take this up in ~ 2 weeks if no one else does.<|||||>> Oh, I wasn't aware of that. I can take this up in ~ 2 weeks if no one else does.

Will or where will you update this after you created it? Thank you so much!<|||||>I can leave a message here after it's done.