我使用的GPU计算神经网络输出和torch.cuda.FloatTensor
(两者都存储在GPU)的点积,但得到一个错误说:无法计算torch.cuda.FloatTensor
TypeError: dot received an invalid combination of arguments - got (torch.cuda.FloatTensor) but expected (torch.FloatTensor tensor).
代码是像
p = torch.exp(vector.dot(ht))
这里载体是炬FloatTensor和HT是神经网络的输出。
我已经为这些事情挣扎了好几天,但仍然不知道。预先感谢任何可能的解决方案!
如果我的答案帮助你解决了你的问题,你可以接受它。 –