Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrblck authored and soumith committed Jun 25, 2018
1 parent a5df8ec commit 50410c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/nn/modules/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class NLLLoss(_WeightedLoss):
>>> data = torch.randn(N, 16, 10, 10)
>>> m = nn.Conv2d(16, C, (3, 3))
>>> # each element in target has to have 0 <= value < C
>>> target = torch.tensor(N, 8, 8).random_(0, C)
>>> target = torch.empty(N, 8, 8, dtype=torch.long).random_(0, C)
>>> output = loss(m(data), target)
>>> output.backward()
"""
Expand Down

0 comments on commit 50410c9

Please sign in to comment.