criterion = nn.CrossEntropyLoss()
for i in range(10):
_, output = torch.max(model(x_train_tensor[i]), 0)
print(output, y_train_tensor[i])
print(criterion(output, y_train_tensor[i]))
===================================
output is:
tensor(0), tensor(0)
error: RuntimeError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
how can i fix it?