# Torch.float vs torch.FloatTensor

**URL:** <https://discuss.pytorch.org/t/torch-float-vs-torch-floattensor/25384>\
**Category:** Uncategorized\
**Created:** [September 18, 2018, 10:40am UTC](https://discuss.pytorch.org/t/torch-float-vs-torch-floattensor/25384 "2018-09-18T10:40:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kong](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kong/32/4215_2.png) [@Kong](https://discuss.pytorch.org/u/Kong)\
**Post date:** [September 18, 2018, 10:40am UTC](https://discuss.pytorch.org/t/torch-float-vs-torch-floattensor/25384/1 "2018-09-18T10:40:48Z")

</div>

What is the difference between

a) `torch.from_numpy(a).type(torch.FloatTensor)`  
b) `torch.from_numpy(a).type(torch.float)` ?

When I installed PyTorch via the command `conda install pytorch torchvision -c pytorch`, (b) works. When I installed PyTorch via the command `conda install pytorch=0.1.12 cuda75 -c pytorch` on another PC, (b) does not work but (a) works.

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [September 18, 2018, 11:00am UTC](https://discuss.pytorch.org/t/torch-float-vs-torch-floattensor/25384/2 "2018-09-18T11:00:23Z")

</div>

Hi,

`torch.float` has been added recently, it was not in old releases like `0.1.xx`, this is why it does not work.
