sampler.py 309 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
12
13
import torch_cluster.sampler_cpu


def neighbor_sampler(start, cumdeg, col, size):
    assert not start.is_cuda

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

    op = torch_cluster.sampler_cpu.neighbor_sampler
    return op(start, cumdeg, col, size, factor)