Skip to content

Commit

Permalink
replace decoder with self.decoder in PyTorch Chatbot example. (#3090)
Browse files Browse the repository at this point in the history
Co-authored-by: Svetlana Karslioglu <[email protected]>
  • Loading branch information
Ishan-Kumar2 and svekars authored Dec 2, 2024
1 parent 1428770 commit f2d5a6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beginner_source/chatbot_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ def forward(self, input_seq, input_length, max_length):
# Forward input through encoder model
encoder_outputs, encoder_hidden = self.encoder(input_seq, input_length)
# Prepare encoder's final hidden layer to be first hidden input to the decoder
decoder_hidden = encoder_hidden[:decoder.n_layers]
decoder_hidden = encoder_hidden[:self.decoder.n_layers]
# Initialize decoder input with SOS_token
decoder_input = torch.ones(1, 1, device=device, dtype=torch.long) * SOS_token
# Initialize tensors to append decoded words to
Expand Down

0 comments on commit f2d5a6a

Please sign in to comment.