Skip to content

fix docs error in torch.nn.functional.nll_loss#6060

Merged
apaszke merged 1 commit intopytorch:masterfrom
sundw2014:patch-1
Mar 28, 2018
Merged

fix docs error in torch.nn.functional.nll_loss#6060
apaszke merged 1 commit intopytorch:masterfrom
sundw2014:patch-1

Conversation

@sundw2014
Copy link
Copy Markdown
Contributor

According to the code in torch/nn/functional.py:1399
(if target.size()[1:] != input.size()[2:]:),
if the size of input is (N, C, d_1, d_2, ..., d_K), the size of target should be (N, d_1, d_2, ..., d_K).

According to the code in _torch/nn/functional.py:1399_
(```if target.size()[1:] != input.size()[2:]:```),
if the size of input is (N, C, d_1, d_2, ..., d_K), the size of target should be (N, d_1, d_2, ..., d_K).
@apaszke apaszke merged commit 8964aab into pytorch:master Mar 28, 2018
@apaszke
Copy link
Copy Markdown
Contributor

apaszke commented Mar 28, 2018

Thank you!

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
According to the code in _torch/nn/functional.py:1399_
(```if target.size()[1:] != input.size()[2:]:```),
if the size of input is (N, C, d_1, d_2, ..., d_K), the size of target should be (N, d_1, d_2, ..., d_K).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants