As you suggest, I add model.eval() and then run it, the condition changes but still get different probability. But this time, 2 and 3 become same:  [-3.5615596771, -3.3041067123,  0.2262650430, -0.5413500071,
5.4653391838,  3.9844801426, -4.7832412720, 14.4310092926,
-6.6198024750, -6.1641607285].
while 1: [-3.5615587234, -3.3041062355,  0.2262653410, -0.5413498878,
5.4653387070,  3.9844801426, -4.7832412720, 14.4310083389,
-6.6198034286, -6.1641597748]
4 : [-3.5615592003, -3.3041067123,  0.2262655199, -0.5413499475,
5.4653387070,  3.9844801426, -4.7832412720, 14.4310073853,
-6.6198034286, -6.1641602516]]
1 and 2 and 4 are different, which means that the data in same batch influence the output.
Are there some mechanism in pytorch which bring the small changes? Thank you again!