From 8cb5f21772d17ac036b4f779eccc849dbf01d7f8 Mon Sep 17 00:00:00 2001 From: RobD Date: Tue, 25 Sep 2018 11:56:16 -0400 Subject: [PATCH] fix incorrect reference (https://github.com/hunkim/PyTorchZeroToAll/issues/31) https://github.com/hunkim/PyTorchZeroToAll/issues/31 --- 12_4_hello_rnn_emb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/12_4_hello_rnn_emb.py b/12_4_hello_rnn_emb.py index 3ab2098..1603ad6 100644 --- a/12_4_hello_rnn_emb.py +++ b/12_4_hello_rnn_emb.py @@ -38,7 +38,7 @@ def forward(self, x): # Initialize hidden and cell states # (num_layers * num_directions, batch, hidden_size) h_0 = Variable(torch.zeros( - self.num_layers, x.size(0), self.hidden_size)) + num_layers, x.size(0), hidden_size)) emb = self.embedding(x) emb = emb.view(batch_size, sequence_length, -1)