Why different coding style obtain different results in Pytorch?

I finally find that it is because I haven’t shuffle the datasets.