I just replaced the GRU in this notebook with the code that I posted above. I also had to pass hx and cx instead of just ‘hidden’ and fix output view in the loss criterion.

  
      
      GitHub
  
  
    

spro/practical-pytorch 366

PyTorch tutorials demonstrating modern techniques with readable code - spro/practical-pytorch