Thanks for your help! I simply installed Anaconda3 and use ‘conda update pytorch’ to updated Pytorch. I ran the test and the output is
Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.cuda._initialized)
False
>>> torch.cuda._lazy_init()

It stopped at the ‘torch.cuda._lazy_init()’ line.