If you calculate the relative difference using:
torch_diff.max()/(x@x.t()).abs().max()

you’ll get differences in the range ~1e-7 to ~1e-6, which points to rounding errors due to the limited floating point precision which are created e.g. by a different order of floating point operations.