Thanks for replying. Yesterday I ran the model on CPU a couple times and it worked fine. Then I ran it back on GPU and it worked as expected again. It seems like the problem went away by itself after not working even after several attempts and even after restarting the machine. So… Idk what caused it. Just FYI I have gtx 1080 and I’m running pytorch 0.4. I can’t seem to reproduce the problem.