This code would resolve the precission problems.
a = torch.all(torch.lt(torch.abs(torch.add(centroids_new, -new_centers)), 1e-5))

This gets rid of the last digit of 1.0000000001 as we are taking into account Float values.