Hi @tom! Great thanks for your explanation! I was wondering why the results are different when I compute the same distance using ((x[:, None, :] - x[:, :, None])**2).sum(-1). Perhaps, there is something that I don’t really understand.