utils.py 280 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
12
13
import torch

torch.ops.load_library('torch_sparse/convert_cpu.so')

try:
    torch.ops.load_library('torch_sparse/convert_cuda.so')
except OSError:
    pass


def ext(is_cuda):
    name = 'torch_sparse_cuda' if is_cuda else 'torch_sparse_cpu'
    return getattr(torch.ops, name)