New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add basic to_one_hot function #4774
Conversation
@pytorchbot c'mon, do something :) |
@justheuristic can you add a test to test_nn.py (see other tests for functional, but can be something simple: give known input and check for known result). Also, add an entry to: https://github.com/pytorch/pytorch/blob/master/docs/source/nn.rst |
Sorry for the delay. Added simple test case and autodoc. |
Almighty @pytorchbot , help me again! |
@pytorchbot test this please |
Test failures are legit |
i wonder if i can do that too |
@pytorchbot test this please |
1 similar comment
@pytorchbot test this please |
0 0 1 | ||
[torch.FloatTensor of size 3x2x3] | ||
""" | ||
y_tensor = y.data if isinstance(y, Variable) else y |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Sorry for missing this @justheuristic. We merged a one_hot implementation in #15208; thank you for your PR nonetheless |
Hello!
This may be covered in some pending pull-request, but if it isn't, here's a simple one-hot function from my collection of pytorch helpers that may or may not be useful :)
It essentially copies this issue.