Usually a device is where you do your computations, for example if you use a GPU your device will be something like cuda:0 or just 0.
So what torch.cuda.current_device() does is to return the identifier of which GPU is currently being used. This can be really helpful for systems with multiple GPUs.
Docs for more information. 18