1: there are 3 GPUs available and visible (indices 0,1,2).
2: because otherwise it would not be the default device anymore but a specific one.
3: usually yes but not necessarily. You can set the default device to another index if you want to.
4: despite the missing index: no
5: yes. If you don’t call x.to(device) but x.cuda() without specifying an index the default GPU will be used again.
6: probably simply left out to provide a compact example.
7: yes. If you set CUDA_VISIBLE_DEVICES to 5,6 and 7 cuda:0 will be GPU 5 and so on.