The error message says whats wrong:
You provide two variables with the types “(torch.cuda.LongTensor, float)” to the function, but it wants e.g. “(torch.cuda.LongTensor tensor, int value)” or one of the other types.
So the problem is your the type of your second argument. Change it appropriate.