Commit 14c7e1c5 authored by rusty1s's avatar rusty1s
Browse files

fix empty col bug

parent e8214d47
......@@ -92,7 +92,8 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
tree = scipy.spatial.cKDTree(x.detach().numpy())
col = tree.query_ball_point(y.detach().numpy(), r)
col = [sample(torch.tensor(c), max_num_neighbors) for c in col]
col = [torch.tensor(c, dtype=torch.long) for c in col]
col = [sample(c, max_num_neighbors) for c in col]
row = [torch.full_like(c, i) for i, c in enumerate(col)]
row, col = torch.cat(row, dim=0), torch.cat(col, dim=0)
mask = col < int(tree.n)
......
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