There are some mistakes in PyTorch documentations

rnn = nn.LSTMCell(10, 20)
input = Variable(torch.randn(6, 3, 10))
hx = Variable(torch.randn(3, 20))
cx = Variable(torch.randn(3, 20))
output = []
for i in range(6):
… hx, cx = rnn(input, (hx, cx))
… output.append(hx)

In the above code, in for loop, i think input should be changed to input[i].
If i’m right, example code for torch.nn.LSTMCell and torch.nn.GRUCell should be changed.

The example codes are here.

Yes, this example is incorrect. Can you please send a PR?