I was playing with nn.LSTM, nn.RNN etc and I found something.
The website states:
rnn = nn.LSTM(10, 20, 2)
input = torch.randn(5, 3, 10)
h0 = torch.randn(2, 3, 20)
c0 = torch.randn(2, 3, 20)
output, (hn, cn) = rnn(input, (h0, c0))
print(output.shape)
>>> torch.Size([5, 3, 20])

And I tried the same thing without h0 and c0 as:
input = torch.randn(5, 3, 10)
rnn = LSTM(10, 20, 2)
output, _ = rnn(input)
print(output.shape)
>>> torch.Size([5, 3, 20])

I wonder what is happening here. Is the model by itself assuming h0,c0?