Hi!
I discovered that torch.cdist(x1, x2, p=2.0, compute_mode='use_mm_for_euclid_dist_if_necessary') function keeps giving similar results even after I changed the p values. Does it means there is a bug in the code?
Thanks!
Here are the code snippets:
x = torch.linspace(0.0, 1.0, 2500).reshape(-1,1)
cdist = torch.cdist(x,x,p=2.0)
print(cdist)

tensor([[0.0000e+00, 4.0016e-04, 8.0032e-04,  ..., 9.9920e-01, 9.9960e-01,
         1.0000e+00],
        [4.0016e-04, 0.0000e+00, 4.0016e-04,  ..., 9.9880e-01, 9.9920e-01,
         9.9960e-01],
        [8.0032e-04, 4.0016e-04, 0.0000e+00,  ..., 9.9840e-01, 9.9880e-01,
         9.9920e-01],
        ...,
        [9.9920e-01, 9.9880e-01, 9.9840e-01,  ..., 0.0000e+00, 4.8828e-04,
         8.0972e-04],
        [9.9960e-01, 9.9920e-01, 9.9880e-01,  ..., 4.8828e-04, 0.0000e+00,
         4.2286e-04],
        [1.0000e+00, 9.9960e-01, 9.9920e-01,  ..., 8.0972e-04, 4.2286e-04,
         0.0000e+00]])

cdist = torch.cdist(x,x,p=1.0)
print(cdist)

tensor([[0.0000e+00, 4.0016e-04, 8.0032e-04,  ..., 9.9920e-01, 9.9960e-01,
         1.0000e+00],
        [4.0016e-04, 0.0000e+00, 4.0016e-04,  ..., 9.9880e-01, 9.9920e-01,
         9.9960e-01],
        [8.0032e-04, 4.0016e-04, 0.0000e+00,  ..., 9.9840e-01, 9.9880e-01,
         9.9920e-01],
        ...,
        [9.9920e-01, 9.9880e-01, 9.9840e-01,  ..., 0.0000e+00, 4.8828e-04,
         8.0972e-04],
        [9.9960e-01, 9.9920e-01, 9.9880e-01,  ..., 4.8828e-04, 0.0000e+00,
         4.2286e-04],
        [1.0000e+00, 9.9960e-01, 9.9920e-01,  ..., 8.0972e-04, 4.2286e-04,
         0.0000e+00]])

cdist = torch.cdist(x,x,p=float('inf'))
print(cdist)

tensor([[0.0000e+00, 4.0016e-04, 8.0032e-04,  ..., 9.9920e-01, 9.9960e-01,
         1.0000e+00],
        [4.0016e-04, 0.0000e+00, 4.0016e-04,  ..., 9.9880e-01, 9.9920e-01,
         9.9960e-01],
        [8.0032e-04, 4.0016e-04, 0.0000e+00,  ..., 9.9840e-01, 9.9880e-01,
         9.9920e-01],
        ...,
        [9.9920e-01, 9.9880e-01, 9.9840e-01,  ..., 0.0000e+00, 4.8828e-04,
         8.0972e-04],
        [9.9960e-01, 9.9920e-01, 9.9880e-01,  ..., 4.8828e-04, 0.0000e+00,
         4.2286e-04],
        [1.0000e+00, 9.9960e-01, 9.9920e-01,  ..., 8.0972e-04, 4.2286e-04,
         0.0000e+00]])