thanks for you!Well,you are right, but I attempt to do it with a new way.Now,  I know how to modify:
…
, predicted = torch.max(outputs.data, 1)
labels.data.copy(predicted)
loss = criterion(outputs, labels)
…
thinks, SherlockLiaoSherlock