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 ...@@ -39,17 +39,16 @@ A greedy clustering algorithm of picking an unmarked vertex and matching it with
import torch import torch
from torch_cluster import graclus_cluster from torch_cluster import graclus_cluster
row = torch.LongTensor([0, 1, 1, 2]) row = torch.tensor([0, 1, 1, 2])
col = torch.LongTensor([1, 0, 2, 1]) col = torch.tensor([1, 0, 2, 1])
weight = torch.Tensor([1, 1, 1, 1]) # Optional edge weights. weight = torch.tensor([1, 1, 1, 1]) # Optional edge weights.
cluster = graclus_cluster(row, col, weight) cluster = graclus_cluster(row, col, weight)
``` ```
``` ```
print(cluster) print(cluster)
0 0 1 tensor([ 0, 0, 1])
[torch.LongTensor of size 3]
``` ```
## VoxelGrid ## VoxelGrid
...@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over ...@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
import torch import torch
from torch_cluster import grid_cluster from torch_cluster import grid_cluster
pos = torch.Tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]]) pos = torch.tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
size = torch.Tensor([5, 5]) size = torch.tensor([5, 5])
cluster = grid_cluster(pos, size) cluster = grid_cluster(pos, size)
``` ```
``` ```
print(cluster) print(cluster)
0 5 3 0 1 tensor([ 0, 5, 3, 0, 1])
[torch.LongTensor of size 5]
``` ```
## Running tests ## 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