I change my code like below:
running_loss = running_loss / N_running
running_correct = 100*running_correct.item() / N_running
testing_correct = 100*testing_correct.item() / N_test

Because running_correct and testing_correct are both Tensor, so I use .item().
I found that the tensor type automatically created by pytorch is torch.LongTensor. The operation between int/long in pytorch is still int. Using item() to convert to scalar, that is, to restore the basic python operation.