pytorch lstm output not match hidden state

I think I had the same question where I also posted my answer. Maybe you can check if it indeed matches your concerns.