Fix wav2vec2 export onnx model with attention_mask error
# What does this PR do?
This PR fixes a problem with wav2vec2 when convert to onnx model with attention_mask. see: https://github.com/huggingface/transformers/issues/10004, https://github.com/pytorch/fairseq/issues/3010#issuecomment-999821804

@patrickvonplaten 


_The documentation is not available anymore as the PR was closed or merged._<|||||>Looks good to me! cc @lewtun <|||||>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.<|||||>Should this be merged?<|||||>Yes I think this can be merged since it's only touching the modelling code and the Wav2Vec2 ONNX export that I'm working on will anyway need this. 

I'll merge once the CI passes<|||||>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.<|||||>@patrickvonplaten @lewtun we probably still need to merge this, if there are no objections :sweat_smile: <|||||>> Sorry just one question - why do we use `repeat` here instead of https://pytorch.org/docs/stable/generated/torch.broadcast_to.html ? Broadcasting should save some memory no?
> 
> Also could we please run all the Wav2Vec2 slow tests ones to make sure there is no unexpected numerical difference?

Yes @anton-l - I'm waiting for a reply to Patrick's comment above. Alternatively, if Patrick agrees we can merge this "as is" (looks good to me)<|||||>Good to merge for me if all Wav2Vec2 slow tests pass (including the pretraining ones). @anton-l could you check it maybe otherwise?<|||||>Slow+pretraining tests are OK, thanks for the fix @nilboy!