

TITLE
[consistent use] `F` vs. `nn.functional`

COMMENTS
8

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
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 
