Commit b94ecee8 authored by rusty1s's avatar rusty1s
Browse files

0.4.0 update

parent abc17fd1
......@@ -39,17 +39,16 @@ A greedy clustering algorithm of picking an unmarked vertex and matching it with
import torch
from torch_cluster import graclus_cluster
row = torch.LongTensor([0, 1, 1, 2])
col = torch.LongTensor([1, 0, 2, 1])
weight = torch.Tensor([1, 1, 1, 1]) # Optional edge weights.
row = torch.tensor([0, 1, 1, 2])
col = torch.tensor([1, 0, 2, 1])
weight = torch.tensor([1, 1, 1, 1]) # Optional edge weights.
cluster = graclus_cluster(row, col, weight)
```
```
print(cluster)
0 0 1
[torch.LongTensor of size 3]
tensor([ 0, 0, 1])
```
## VoxelGrid
......@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
import torch
from torch_cluster import grid_cluster
pos = torch.Tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
size = torch.Tensor([5, 5])
pos = torch.tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
size = torch.tensor([5, 5])
cluster = grid_cluster(pos, size)
```
```
print(cluster)
0 5 3 0 1
[torch.LongTensor of size 5]
tensor([ 0, 5, 3, 0, 1])
```
## Running tests
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment