From 2077295ccb52400b714f39000ccc6e9ecac7400d Mon Sep 17 00:00:00 2001 From: Ishan Kumar Date: Sun, 13 Oct 2024 15:47:22 -0400 Subject: [PATCH] replace decoder with self.decoder --- beginner_source/chatbot_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/chatbot_tutorial.py b/beginner_source/chatbot_tutorial.py index f902f8cd717..ee274866895 100644 --- a/beginner_source/chatbot_tutorial.py +++ b/beginner_source/chatbot_tutorial.py @@ -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