the compiler tells: reciprocal is not implemented for type torch.cuda.LongTensor? how can i solve this problem??

linux:16.04
pytorch:version 0.4.0

when i try to google this problem. this post tells me i should change the pytorch version to 0.3.0, however i do not want degrade my cuda and pytorch version. thanks~

another method to sove this problem is try to convert the long tensor to float tensor, however when i convert the long tensor to float tensor another problem occurs.

i have use the .float() to convert long tensor to float tensor, however another problem occurs. if this is the right way, maybe i should try to solve another problem