a = Variable(torch.LongTensor(torch.rand(2, 3)))
The error:
TypeError Traceback (most recent call last)
<ipython-input-12-f8802b707ca7> in <module>()
----> 1 a = Variable(torch.LongTensor(torch.rand(2, 3)))
TypeError: torch.LongTensor constructor received an invalid combination of arguments - got (torch.FloatTensor), but expected one of:
* no arguments
* (int ...)
didn't match because some of the arguments have invalid types: (torch.FloatTensor)
* (torch.LongTensor viewed_tensor)
didn't match because some of the arguments have invalid types: (torch.FloatTensor)
* (torch.Size size)
didn't match because some of the arguments have invalid types: (torch.FloatTensor)
* (torch.LongStorage data)
didn't match because some of the arguments have invalid types: (torch.FloatTensor)
* (Sequence data)
didn't match because some of the arguments have invalid types: (torch.FloatTensor)
Why is not there a conversion?Is it just a code style, or just a little bug?