ffi.py 317 Bytes
Newer Older
rusty1s's avatar
gputest  
rusty1s committed
1
2
3
4
import torch
from torch_cluster._ext import ffi

cluster = torch.cuda.LongTensor(5)
rusty1s's avatar
rusty1s committed
5
6
7
pos = torch.cuda.FloatTensor([[1, 1], [3, 3], [1, 1], [5, 5], [3, 3]])
size = torch.cuda.FloatTensor([2, 2])
count = torch.cuda.LongTensor([3, 3])
rusty1s's avatar
gputest  
rusty1s committed
8
9
10
11
12

func = ffi.THCCFloatGrid
print(func)

func(cluster, pos, size, count)
rusty1s's avatar
rusty1s committed
13
print(cluster)