Skip to content

Commit

Permalink
fix Runtime error in Library tutorial (OpenNMT#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
elisemicho authored and vince62s committed Apr 17, 2019
1 parent db4d2fb commit dcaeb23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/Library.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ model.to(device)
# Specify the tgt word generator and loss computation module
model.generator = nn.Sequential(
nn.Linear(rnn_size, len(tgt_vocab)),
nn.LogSoftmax(dim=-1))
nn.LogSoftmax(dim=-1)).to(device)

loss = onmt.utils.loss.NMTLossCompute(
criterion=nn.NLLLoss(ignore_index=tgt_padding, reduction="sum"),
Expand Down

0 comments on commit dcaeb23

Please sign in to comment.