There is a minor bug in run_pretrain.py for Wav2Vec2 example
### System Info

```shell
- `transformers` version: 4.18.0
- Platform: Linux-4.15.0-144-generic-x86_64-with-glibc2.27
- Python version: 3.9.12
- Huggingface_hub version: 0.5.1
- PyTorch version (GPU?): 1.7.1+cu110 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>
```


### Who can help?

@patrickvonplaten
I found a minor bug in [run_pretrain.py](https://github.com/huggingface/transformers/tree/main/examples/research_projects/wav2vec2/run_pretrain.py)

```python
from transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices
.
.
.
class DataCollatorForWav2Vec2Pretraining:
...
  # sample randomly masked indices
        batch["mask_time_indices"] = _compute_mask_indices(
            (batch_size, mask_indices_seq_length),
            self.model.config.mask_time_prob,
            self.model.config.mask_time_length,
            device=batch["input_values"].device, # this!
            attention_mask=attention_mask,
            min_masks=2,
        )
        return batch
```
_compute_mask_indices take device parameter, but in [modeling_wav2vec2.py](https://github.com/huggingface/transformers/blob/main/src/transformers/models/wav2vec2/modeling_wav2vec2.py)
```python
def _compute_mask_indices(
    shape: Tuple[int, int],
    mask_prob: float,
    mask_length: int,
    attention_mask: Optional[torch.LongTensor] = None,
    min_masks: int = 0,
) -> np.ndarray:
```
device parameter does not exist, I think this hasn't been modified yet.

And thank you for the huggingface that makes good libraries!

### Information

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

### Tasks

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

### Reproduction

```python
@dataclass
class DataCollatorForWav2Vec2Pretraining:
...
        # sample randomly masked indices
        batch["mask_time_indices"] = _compute_mask_indices(
            (batch_size, mask_indices_seq_length),
            self.model.config.mask_time_prob,
            self.model.config.mask_time_length,
            device=batch["input_values"].device,
            attention_mask=attention_mask,
            min_masks=2,
        )

        return batch
```


### Expected behavior

```shell
@dataclass
class DataCollatorForWav2Vec2Pretraining:
...
        # sample randomly masked indices
        batch["mask_time_indices"] = _compute_mask_indices(
            (batch_size, mask_indices_seq_length),
            self.model.config.mask_time_prob,
            self.model.config.mask_time_length,
            attention_mask=attention_mask,
            min_masks=2,
        )

        return batch
```

Hey @ddobokki,

good observation! Would you like to open a PR to fix it? :-)<|||||>Ok! I will 😁