I tried everything to only the following steps works: The cuda 10 is too new for my graphic card.
(1)go to previous version of cuda & pytorch here:

  
      
      pytorch.org
  
  
    

PyTorch 47

An open source deep learning platform that provides a seamless path from research prototyping to production deployment.


  
  
    
    
  
  


(2)following the page instruction and download *.whl file suitable for my python version and platform. for me it’s python 3.6 , windows
(3)install *.whl file
(4)test if torch.cuda.is_available()  returns True
I am running windows 10 with Nvidia GTX 1070