L1aoXingyu / pytorch-beginner

pytorch tutorial for beginners
3k stars 1.09k forks source link

Zero accuracy in 03 Logistic Regression #16

Open icemiliang opened 6 years ago

icemiliang commented 6 years ago

Accuracies are all zeros. Need to convert torch tensor to float

line 68: running_acc += num_correct.data[0] -->running_acc += num_correct.data[0].float()

line 98: eval_acc += num_correct.data[0] --> eval_acc += num_correct.data[0].float()