Sorry, I don’t know if the function you need exists. But I can show you what I will do:
coords_A = coords.view(coords.shape[0], 1, 3).repeat(1, coords.shape[0], 1)
coords_B = coords.view(1, coords.shape[0], 3).repeat(coords.shape[0], 1, 1)
coords_confusion = torch.stack((coords_A, coords_B), dim=2)
every_dist = ((coords_confusion[:, :, 0, :] - coords_confusion[:, :, 1, :]) ** 2).sum(dim=2) ** 0.5
# now every_dist[i,j] would be the distance of coords[i] and coords[j]