when autograd computes the derivative wrt your variable predicted_labels (derivative of 1/x is -1/x^2) it uses .neg() for the “-”. But  predicted_labels is a LongTensor (argmax), for with neg is not implemented.
Try:
predicted_labels = torch.max(input, 1)[1].float()