Skip to content

Add to_one_hot function #15060

@zou3519

Description

@zou3519

🚀 Feature

Convert a tensor of index values to one-hot encoding

Motivation

It's kind of strange not to have it

Pitch

This old PR does it: #4774

also torch.distributions has it as well, we should just expose it as part of torch.*

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions