I was following the tutorial below, which does that. I think it’s just initialising the very first hidden state for each batch, isn’t it? I don’t use the return value though. Does it serve any use outside of training the model?

  
      
      FloydHub Blog – 29 Apr 19
  
  
    

Beginner’s Guide on Recurrent Neural Networks with PyTorch 1

Learn the basics of Recurrent Neural Networks and build a simple Language Model with PyTorch