Skip to content

Commit a266f8e

Browse files
authored
Merge pull request #9 from denix56/triton
Triton
2 parents 163fd6a + fb40555 commit a266f8e

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
@@ -32,6 +32,15 @@ def _(src, ptr, ratio, random_start=True):
3232
nnz = ctx.new_dynamic_size()
3333
return ptr.new_empty((nnz,))
3434

35+
@torch.library.register_fake("torch_cluster::fps")
36+
def _(src, ptr, ratio, random_start=True):
37+
torch._check(src.device == ptr.device)
38+
torch._check(ptr.ndim == 1)
39+
40+
ctx = torch.library.get_ctx()
41+
nnz = ctx.new_dynamic_size()
42+
return ptr.new_empty((nnz,))
43+
3544

3645
def fps( # noqa
3746
src: torch.Tensor,

0 commit comments

Comments
 (0)