Apparently, there’s also an issue with 1.2 here: .cuda() Problem - I can’t transfer objects to the GPU.
Indeed, I had this problem while running PyTorch 1.2. It seems it was related to a Conda PyTorch install (version doesn’t seem to matter) and CUDA 10.1. This was fixed and all you need to do is reinstall it from Conda.