# How to convert labels into one-hot encoded tensors

**URL:** <https://discuss.pytorch.org/t/how-to-convert-labels-into-one-hot-encoded-tensors/49192>\
**Category:** Uncategorized\
**Created:** [June 28, 2019, 5:58am UTC](https://discuss.pytorch.org/t/how-to-convert-labels-into-one-hot-encoded-tensors/49192 "2019-06-28T05:58:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Pranavan\_Theivendira](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/pranavan_theivendira/32/12366_2.png) [@Pranavan\_Theivendira](https://discuss.pytorch.org/u/Pranavan_Theivendira)\
**Post date:** [June 28, 2019, 10:04am UTC](https://discuss.pytorch.org/t/how-to-convert-labels-into-one-hot-encoded-tensors/49192/2 "2019-06-28T10:04:07Z")

</div>

Hi,

This topic has been discussed previously. Have a look at this [thread](https://discuss.pytorch.org/t/convert-int-into-one-hot-format/507/3).

---

_[View the full topic](https://discuss.pytorch.org/t/how-to-convert-labels-into-one-hot-encoded-tensors/49192)._
