我可以将torch.HalfTensor
设置为默认值并将其与CUDA一起使用吗?
我甚至无法创建通常的Conv2D:
In [1]: import torch
In [2]: torch.__version__
Out[2]: '0.2.0_3'
In [3]: from torch import nn
In [4]: torch.set_default_tensor_type('torch.HalfTensor')
In [5]: conv1 = nn.Conv2d(1, 64, kernel_size=3, stride=1, padding=1, bias=False)
terminate called after throwing an instance of 'std::invalid_argument'
what(): Unsupported tensor type
Aborted (core dumped)
UPD:在没有CUDA的情况下它也不起作用,但我对 支持CUDA的情况感兴趣。