Solved by David_Reiss in post #7 
              
              
                Oh, no.  Sorry.  I meant it is a bug in PyTorch, and that commit should fix it.  Please try again with the latest nightly release, without changing any of your code, and the problem should be gone.