Type torch.LongTensor doesn't implement stateless method dist

In [327]: myt = torch.LongTensor([i for i in range(100)])

In [328]: torch.dist(myt,myt)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-328-6ecb2e5af07e> in <module>()
----> 1 torch.dist(myt,myt)

TypeError: Type torch.LongTensor doesn't implement stateless method dist

yes, dist is only implemented for Float,Double

Long is typically used for storing target. Try converting it to a float type using tensor.type(‘FloatTensor’) if you need to do a dist function!