Skip to content

Commit 5b10411

Browse files
yunjeysoumith
authored andcommitted
Fixed some mistakes in examples
Fixed mistakes in LSTMCell and GRUCell examples.
1 parent 4c474a9 commit 5b10411

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torch/nn/modules/rnn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class LSTMCell(RNNCellBase):
441441
>>> cx = Variable(torch.randn(3, 20))
442442
>>> output = []
443443
>>> for i in range(6):
444-
... hx, cx = rnn(input, (hx, cx))
444+
... hx, cx = rnn(input[i], (hx, cx))
445445
... output.append(hx)
446446
"""
447447

@@ -510,8 +510,8 @@ class GRUCell(RNNCellBase):
510510
>>> hx = Variable(torch.randn(3, 20))
511511
>>> output = []
512512
>>> for i in range(6):
513-
... hx = rnn(input, hx)
514-
... output[i] = hx
513+
... hx = rnn(input[i], hx)
514+
... output.append(hx)
515515
"""
516516

517517
def __init__(self, input_size, hidden_size, bias=True):

0 commit comments

Comments
 (0)