-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve one_hot #15457
Comments
@zou3519 : Mind if I take a look at this? |
I think the conclusion from @zasdfgbnm on this was that it's very easy to make this API change on the pytorch side but making the JIT support this as well was a little more involved |
optional dtype is pretty import IMO. returning a long tensor is useless is many cases. |
Constructor functions should natively expose I'm not sure this deserves to be high-pri though, as |
@fmassa I would say that this is not a ctor function. However, it should have a |
Also in #33046 I propose changing default dtype to bool/byte from long. |
It would also be good if |
it would be also good to support 2D and 3D inputs, to create a multi-channel 2D or 3D array (without the need for view/reshape) |
As discussed in #15208, the following improve can be made on
torch.nn.functional.ont_hot
:num_classes
parameterint64_t?
instead ofint64_t num_classes = -1
cc: @zou3519 @vadimkantorov
cc @albanD @mruberry
The text was updated successfully, but these errors were encountered: