Skip to content

Commit 163fd6a

Browse files
authored
Add Triton support (#8)
* Compute split-N tile counts via heuristics * Add Triton support * Add Triton support * Add Triton support * Fix flake8 errors remove triton from dependencies * Remove meaningless comments
1 parent fcd64f2 commit 163fd6a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

torch_cluster/fps.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ def _(src, ptr, ratio, random_start=True):
2323
nnz = ctx.new_dynamic_size()
2424
return ptr.new_empty((nnz,))
2525

26+
@torch.library.register_fake("torch_cluster::fps")
27+
def _(src, ptr, ratio, random_start=True):
28+
torch._check(src.device == ptr.device)
29+
torch._check(ptr.ndim == 1)
30+
31+
ctx = torch.library.get_ctx()
32+
nnz = ctx.new_dynamic_size()
33+
return ptr.new_empty((nnz,))
34+
2635

2736
def fps( # noqa
2837
src: torch.Tensor,

0 commit comments

Comments
 (0)