Hi,

This is a simple but weird problem I encountered.

def cantor( a,b):

return 0.5*(a+b)*(a+b+1)+b

print( cantor(5804,5) ) #-- (1)

print( cantor( torch.tensor(5804), torch.tensor(5) ) ) #–(2)

At (1), it gives the correct answer, 16875150.0.

At (2), it gives the wrong answer, tensor( 16875148. )

Hmm… confusing me…

Can someone enlighten me?

Regards,

Joe