Skip to content

Commit 809f27e

Browse files
David Pollacksoumith
David Pollack
authored andcommitted
Fix CrossEntropyLoss in transformers tutorial (#695)
Signed-off-by: David Pollack <david@i2x.ai>
1 parent feca7bc commit 809f27e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/transformer_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def forward(self, src):
8686
src = self.pos_encoder(src)
8787
output = self.transformer_encoder(src, self.src_mask)
8888
output = self.decoder(output)
89-
return F.log_softmax(output, dim=-1)
89+
return output
9090

9191

9292
######################################################################

0 commit comments

Comments
 (0)