Skip to content
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

Closed
wants to merge 16 commits into from

Conversation

justheuristic
Copy link

@justheuristic justheuristic commented Jan 22, 2018

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.

@justheuristic justheuristic changed the title add basic to_one_hot function (in progress) add basic to_one_hot function Jan 22, 2018
@justheuristic justheuristic changed the title (in progress) add basic to_one_hot function add basic to_one_hot function Jan 22, 2018
@justheuristic
Copy link
Author

@pytorchbot c'mon, do something :)

@soumith
Copy link
Member

soumith commented Jan 22, 2018

@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

@justheuristic
Copy link
Author

Sorry for the delay. Added simple test case and autodoc.

@justheuristic
Copy link
Author

justheuristic commented Feb 27, 2018

@soumith @ezyang
Is there anything else to add?

@justheuristic
Copy link
Author

Almighty @pytorchbot , help me again!

@ezyang
Copy link
Contributor

ezyang commented Mar 18, 2018

@pytorchbot test this please

@ezyang
Copy link
Contributor

ezyang commented Mar 23, 2018

Test failures are legit

@justheuristic
Copy link
Author

justheuristic commented Mar 25, 2018

i wonder if i can do that too

@justheuristic
Copy link
Author

@pytorchbot test this please

1 similar comment
@ezyang
Copy link
Contributor

ezyang commented Mar 26, 2018

@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.

@weiyangfb weiyangfb added the awaiting response (this tag is deprecated) This tag is deprecated while we figure out what to do with it label Aug 14, 2018
@zou3519
Copy link
Contributor

zou3519 commented Jan 29, 2019

Sorry for missing this @justheuristic. We merged a one_hot implementation in #15208; thank you for your PR nonetheless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response (this tag is deprecated) This tag is deprecated while we figure out what to do with it in progress open source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants