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
.