Skip to content

Conversation

@bharatr21
Copy link
Contributor

Fix #17801 to add an exception regarding ignore_index in the documentation for torch.nn.CrossEntropyLoss and torch.nn.NLLLoss

If any other files/functions are hit, I'd be glad to incorporate the changes there too! 😊

@ezyang
Copy link
Contributor

ezyang commented Mar 19, 2019

I think the wording here is still confusing. @tomahawk810, do you have any opinions here?

@tomahawk810
Copy link

I think it helps but indeed the wording could be more accurate. I find the "except" not ideal.
Here is a proposition to replace the added text between parentheses:

Additionally to that range of values, any integer specified by ignore_index is also allowed in target.

@ezyang
Copy link
Contributor

ezyang commented Mar 20, 2019

@tomahawk810 I copy-edited it some more. Please take a look and see if it looks clear to you.

@tomahawk810
Copy link

@ezyang looks good to me.

Note that there is a typo: a double ";" on line 856

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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.

torch.nn.CrossEntropyLoss (and related losses): misleading regarding ignore_index

5 participants