Issue with tensor: RuntimeError element 0 of tensors does not require grad and does not have a grad_fn

so, outputs = torch.argmax(outputs, 1, keepdim=True) ?