We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError Traceback (most recent call last) Cell In[21], line 4 1 encoder = d2l.Seq2SeqEncoder(vocab_size=10, embed_size=8, num_hiddens=16, 2 num_layers=2) 3 encoder.eval() ----> 4 decoder = Seq2SeqAttentionDecoder(vocab_size=10, embed_size=8, num_hiddens=16, 5 num_layers=2) 6 decoder.eval() 7 X = torch.zeros((4, 7), dtype=torch.long) # (batch_size,num_steps)
Cell In[20], line 5 2 def init(self, vocab_size, embed_size, num_hiddens, num_layers, 3 dropout=0, **kwargs): 4 super(Seq2SeqAttentionDecoder, self).init(**kwargs) ----> 5 self.attention = d2l.AdditiveAttention( 6 num_hiddens, num_hiddens, num_hiddens, dropout) 7 self.embedding = nn.Embedding(vocab_size, embed_size) 8 self.rnn = nn.GRU( 9 embed_size + num_hiddens, num_hiddens, num_layers, 10 dropout=dropout)
TypeError: init() takes 3 positional arguments but 5 were given
The text was updated successfully, but these errors were encountered:
d2l-zh\pytorch\chapter_attention-mechanisms\bahdanau-attention.ipynb
Sorry, something went wrong.
d2l==0.17.2 or d2l==1.0+ not work
No branches or pull requests
TypeError Traceback (most recent call last)
Cell In[21], line 4
1 encoder = d2l.Seq2SeqEncoder(vocab_size=10, embed_size=8, num_hiddens=16,
2 num_layers=2)
3 encoder.eval()
----> 4 decoder = Seq2SeqAttentionDecoder(vocab_size=10, embed_size=8, num_hiddens=16,
5 num_layers=2)
6 decoder.eval()
7 X = torch.zeros((4, 7), dtype=torch.long) # (batch_size,num_steps)
Cell In[20], line 5
2 def init(self, vocab_size, embed_size, num_hiddens, num_layers,
3 dropout=0, **kwargs):
4 super(Seq2SeqAttentionDecoder, self).init(**kwargs)
----> 5 self.attention = d2l.AdditiveAttention(
6 num_hiddens, num_hiddens, num_hiddens, dropout)
7 self.embedding = nn.Embedding(vocab_size, embed_size)
8 self.rnn = nn.GRU(
9 embed_size + num_hiddens, num_hiddens, num_layers,
10 dropout=dropout)
TypeError: init() takes 3 positional arguments but 5 were given
The text was updated successfully, but these errors were encountered: