support batch-sampler in trainer 
# 🚀 Feature request

Hi
Currently Trainer class  only supports sampler, but not batch-sampler, (the sampling strategies based on batches, which are a group of samplers in torch), if a user wants to use batch-sampler, currently Trainer class introduces unwanted bugs, but not setting epoch for this type of samplers.  If a user is careful enough, he/she still need to overwrite the whole ```train``` function, which is a big chunk of code, could you make this line a function, so the user easily overwrite it for the case of batch-sampler? This part of trainer also introduces bugs specially, if a user use user-defined samplers as well, and not being careful to set epoch for them. 

```
 if isinstance(train_dataloader.sampler, DistributedSampler):
                    train_dataloader.sampler.set_epoch(epoch)
```               
so the user might need to set it to:

```
 train_dataloader.batch_sampler.set_epoch(epoch)
```

thanks 


## Motivation

supporting all type of samplers in Trainer, or making set_epoch a function so user can overwrite it nicely 

@sgugger 

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.