View not implemented for type torch.HalfTensor

Trying to use views with halfTensors, I get this error:

>>> import torch
>>> torch.__version__
'1.0.1.post2'
>>> t = torch.tensor([1,2,3,4.]).half()
>>> t.view(-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: _th_view is not implemented for type torch.HalfTensor

This seems weird as some libraries such as Apex are using torch._utils._flatten_dense_tensors with torch.HalfTensor, and that function relies on view.

It seems to be supported in the nightly builds (I’ve tested it on 1.1.0.dev20190423).
However, as far as I know more FP16 operations are implemented on the GPU, as Apex is currently designed to work on the GPU.

Thanks for your answer! It worked after upgrading my pytorch version to the latest nightly build.

Cheers,