sampler.py 299 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
import torch_cluster.sampler_cpu


rusty1s's avatar
rusty1s committed
4
def neighbor_sampler(start, cumdeg, size):
rusty1s's avatar
rusty1s committed
5
6
7
8
9
10
11
12
    assert not start.is_cuda

    factor = 1
    if isinstance(size, float):
        factor = size
        size = 2147483647

    op = torch_cluster.sampler_cpu.neighbor_sampler
rusty1s's avatar
rusty1s committed
13
    return op(start, cumdeg, size, factor)