Open
Description
Related: pytorch/pytorch#31378
Current implementation:
pytorch_cluster/csrc/cuda/knn_cuda.cu
Line 56 in dbcafbe
As introduced in the linked PR for PyTorch, normalizing the vectors first and then doing the inner product could prevent overflow for vectors with large norms. In addition, this could ensure the calculated cosine similarity is within the range [-1, +1]
.