thanks for your reply. here is my error message. it can only work well in the first train epoch.
if i delete the outputs in test_class,it trains well,and tests well,but i cannot see the classification accuracy.
C:\Users\asus\anaconda3\envs\pytorch\python.exe C:/Users/asus/PycharmProjects/first_pytorch/CIFAR-10/qqqqqqq.py
Files already downloaded and verified
Files already downloaded and verified
[1,  2000] loss: 2.199
[1,  4000] loss: 1.851
[1,  6000] loss: 1.665
[1,  8000] loss: 1.550
[1, 10000] loss: 1.501
[1, 12000] loss: 1.445
Finished Training
Accuracy of the network on the 10000 test images: 48 %
Traceback (most recent call last):
  File "C:/Users/asus/PycharmProjects/first_pytorch/CIFAR-10/qqqqqqq.py", line 108, in <module>
    test_class()
  File "C:/Users/asus/PycharmProjects/first_pytorch/CIFAR-10/qqqqqqq.py", line 102, in test_class
    print(100 * class_correct[i] / class_total[i],'\n')
RuntimeError: "div_cpu" not implemented for 'Bool'
plane

Process finished with exit code 1