Solved by richard in post #2 
              
              
                How did you install pytorch? Sometimes a hanging like this can be caused by the version of cuda you have (7.5) not matching the version of cuda used to build pytorch.