Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Support label_smoothing in cross_entropy#450

Closed
jbschlosser wants to merge 1 commit into
pytorch:masterfrom
jbschlosser:ce_label_smoothing
Closed

Support label_smoothing in cross_entropy#450
jbschlosser wants to merge 1 commit into
pytorch:masterfrom
jbschlosser:ce_label_smoothing

Conversation

@jbschlosser

Copy link
Copy Markdown

Adds awareness of the new label_smoothing functionality in cross_entropy added in pytorch/pytorch#63122 to nestedtensor's implementation.

Fixes broken test: test.test_nested_tensor_functional.TestFunctional.

options = options.ignore_index(ignore_index.value());
}
if (label_smoothing.has_value()) {
options = options.label_smoothing(label_smoothing.value());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Check failures are due to F::CrossEntropyFuncOptions not having a label_smoothing arg, although it's present in master (https://github.com/pytorch/pytorch/blob/92b31b59aff908fcecb76e5baff5bb52ce62608a/torch/csrc/api/include/torch/nn/options/loss.h#L666). What's the deal here?

@jbschlosser

Copy link
Copy Markdown
Author

Closing and reopening diff from the FB side

@jbschlosser jbschlosser closed this Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants