error.update updates the AverageMeter for the prediction errors, i.e. it’s keeping track of the average error, the sum of all falsely predicted samples, etc.
torch.ne performs the “not equal” operation. You can find the docs here 2.
The error points probably to the dtypes of the argument to torch.ne.
Most likely pred is a torch.LongTensor, while you cast target to float.
Try to remove the .float() cast or cast `pred to float as well.