[consistent use] `F` vs. `nn.functional`
We use 3 different ways of doing the same:
1. `F.foo()`
2. `nn.functional.foo()`
3. `torch.nn.functional.foo()`

and these could also be imported:

4. `from torch.nn.functional import foo; foo()`

Asking others it appears that `F` is not quite liked, so it's 2, 3 or 4.

2 and 3 often lead to longer lines which autoformatter wraps, leading to 3 lines of code instead of 1 and which gives less readable code.

So it seems that option 4 might be the best outcome.

For 2, the global update would be easy:
```
find . -type d -name ".git" -prune -o -type f -exec perl -pi -e 's|from torch.nn import functional as F||'  {} \;
find . -type d -name ".git" -prune -o -type f -exec perl -pi -e 's|import torch.nn.functional as F||'  {} \;
find . -type d -name ".git" -prune -o -type f -exec perl -pi -e 's| F\.| nn.functional.|g'  {} \;
make fixup
```

For 4, it will take much more work, but can be semi-automated.

@LysandreJik, @sgugger, @patrickvonplaten 

I personally vote for 4, and if there is any risk of ambiguity, doing
```
from torch.nn.functional import foo as torch_foo
```
<|||||>2 or 4 for me, but I don't have strong feeling about this issue<|||||>2 looks good to me but no strong feelings either<|||||>I further analyzed the codebase and it looks like we use `nn.` almost exclusively, for all other cases outside of `nn.functional`, with an occasional `torch.nn.` 

So I'd say 2 is probably the most consistent way, unless we start explicitly importing `Parameter`, `Embedding`, `ModuleList` from `nn`.

I know the additional "functional" string pushes some single lines into autoformatter's 3 lines mode. But for consistency I think sticking to just a single:
```
from torch import nn
```
is a goodness.

@sgugger,  will option 2 work for you?<|||||>If we stick to 2, then I will also normalize `s|torch.nn.foo|nn.foo|` calls unless you object. <|||||>That works for me.<|||||>Status:

merged:
- [x] src https://github.com/huggingface/transformers/pull/12124
- [x] examples https://github.com/huggingface/transformers/pull/12156
- [x] templates https://github.com/huggingface/transformers/pull/12153
- [x] tests https://github.com/huggingface/transformers/pull/12155
- [x] docs https://github.com/huggingface/transformers/pull/12161<|||||>just need to merge docs, but all is done here.