How does RNN output calculated in Pytorch?

I found this very helpful