I used the following command to install pytorch.

pip3 install https://download.pytorch.org/whl/cu91/torch-0.4.0-cp35-cp35m-linux_x86_64.whl

Since there is no cuda 10 + torch 0.4.0, I choose the closest one.