You could install CUDA10.0 locally and build PyTorch from source as described here 151. If I’m not mistaken, CUDA10 wasn’t released yet when PyTorch 0.4 came out.
What’s the reason you are using such an old PyTorch version?