# How to cast a tensor to another type?

**URL:** <https://discuss.pytorch.org/t/how-to-cast-a-tensor-to-another-type/2713>\
**Category:** Uncategorized\
**Created:** [May 5, 2017, 7:14pm UTC](https://discuss.pytorch.org/t/how-to-cast-a-tensor-to-another-type/2713 "2017-05-05T19:14:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ypxie](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/y/43a26b/32.png) [@ypxie](https://discuss.pytorch.org/u/ypxie)\
**Post date:** [May 5, 2017, 7:16pm UTC](https://discuss.pytorch.org/t/how-to-cast-a-tensor-to-another-type/2713/2 "2017-05-05T19:16:54Z")

</div>

`tensor.double()`

…

---

_[View the full topic](https://discuss.pytorch.org/t/how-to-cast-a-tensor-to-another-type/2713)._
