|
1 | 1 | #pragma once |
| 2 | +#include <torch/library.h> |
2 | 3 |
|
3 | 4 | #include "extensions.h" |
4 | 5 |
|
@@ -37,3 +38,17 @@ random_walk(torch::Tensor rowptr, torch::Tensor col, torch::Tensor start, |
37 | 38 |
|
38 | 39 | CLUSTER_API torch::Tensor neighbor_sampler(torch::Tensor start, torch::Tensor rowptr, |
39 | 40 | int64_t count, double factor); |
| 41 | + |
| 42 | +TORCH_LIBRARY(torch_cluster, m) { |
| 43 | + m.def("fps(Tensor src, Tensor ptr, Tensor ratio, bool random_start = False) -> Tensor"); |
| 44 | + m.def("graclus(Tensor rowptr, Tensor col, Tensor? weight = None) -> Tensor"); |
| 45 | + m.def("grid(Tensor pos, Tensor size, Tensor? start = None, Tensor? end = None) -> Tensor"); |
| 46 | + m.def("knn(Tensor a, Tensor b, Tensor? ptr_x, Tensor? ptr_y, int k, bool cosine = False, int num_workers = 1) -> Tensor"); |
| 47 | + m.def("nearest(Tensor x, Tensor y, Tensor ptr_x, Tensor ptr_y) -> Tensor"); |
| 48 | + m.def("radius(Tensor x, Tensor y, Tensor? ptr_x, Tensor? ptr_y, float r, int max_num_neighbors, int num_workers = 1, bool ignore_same_index = False) -> Tensor"); |
| 49 | + m.def("random_walk(Tensor rowptr, Tensor col, Tensor start, int walk_length, float p = 1, float q = 1) -> (Tensor, Tensor)"); |
| 50 | + m.def("neighbor_sampler(Tensor start, Tensor rowptr, int count, float factor) -> Tensor"); |
| 51 | + m.def("cuda_version() -> int"); |
| 52 | +} |
| 53 | + |
| 54 | +} |
0 commit comments