@ashu  If your are facing this problem every time you import torch the it is better to reinstall pytorch package from below link

  
      
      pytorch.org
  
  
    

PyTorch 71

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


  
  
    
    
  
  


Choose your specification like OS, Package(eg: anaconda, pip), cuda version for gpu use.