Reputation: 4597
I'm posting this question for those who made the same error I did. I got this error when trying to compute my gradients:
criterion = torch.nn.CrossEntropyLoss()
loss = criterion(y_hat, y_truth)
loss.backwards()
Upvotes: 14
Views: 7569