Unverified Commit 8a467e8c authored by Ahmed Ibrahim's avatar Ahmed Ibrahim Committed by GitHub
Browse files

Update knn.py

Fix a bug in the example code inside the knn function
parent 75216b3c
...@@ -42,7 +42,7 @@ def knn(x: torch.Tensor, y: torch.Tensor, k: int, ...@@ -42,7 +42,7 @@ def knn(x: torch.Tensor, y: torch.Tensor, k: int,
x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]]) x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
batch_x = torch.tensor([0, 0, 0, 0]) batch_x = torch.tensor([0, 0, 0, 0])
y = torch.Tensor([[-1, 0], [1, 0]]) y = torch.Tensor([[-1, 0], [1, 0]])
batch_x = torch.tensor([0, 0]) batch_y = torch.tensor([0, 0])
assign_index = knn(x, y, 2, batch_x, batch_y) assign_index = knn(x, y, 2, batch_x, batch_y)
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment