I am experimenting with [https://github.com/gpleiss/efficient_densenet_pytorch/blob/master/demo.py 2](http://memory efficient densenets)
When calculating the accuracy and error they use:

measure accuracy and record loss
batch_size = target.size(0)
_, pred = output.data.cpu().topk(1, dim=1)
error.update(torch.ne(pred.squeeze(), target.cpu()).float().sum() / batch_size, batch_size)
losses.update(loss.item(), batch_size)

error is a custom class earlier which keeps track of errors:

def update(self, val, n=1):
self.val = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.count

In particular, what is the error.update line doing? I cannot find torch.ne in the documentation and I’m getting errors when I use this. (I am using my own data and my datatypes do not match up: RuntimeError: Expected object of type torch.LongTensor but found type torch.FloatTensor for argument #2 'other')