alireza7:

print( torch.abs(  (r2 - r1)  ).sum()   )



This can be expected. On an item by item basis, you have a typical floating point difference for fp32:
(r1-r2).abs().max()
tensor(6.4850e-05)

As you have 4.2e5 items, you end up with a the difference you see. So everything is as expected here, but if you depend on the difference, you probably want fp64 for at least part of your computation.
Best regards
Thomas