Skip to content

Commit b94ecee

Browse files
committed
0.4.0 update
1 parent abc17fd commit b94ecee

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@ A greedy clustering algorithm of picking an unmarked vertex and matching it with
3939
import torch
4040
from torch_cluster import graclus_cluster
4141

42-
row = torch.LongTensor([0, 1, 1, 2])
43-
col = torch.LongTensor([1, 0, 2, 1])
44-
weight = torch.Tensor([1, 1, 1, 1]) # Optional edge weights.
42+
row = torch.tensor([0, 1, 1, 2])
43+
col = torch.tensor([1, 0, 2, 1])
44+
weight = torch.tensor([1, 1, 1, 1]) # Optional edge weights.
4545

4646
cluster = graclus_cluster(row, col, weight)
4747
```
4848

4949
```
5050
print(cluster)
51-
0 0 1
52-
[torch.LongTensor of size 3]
51+
tensor([ 0, 0, 1])
5352
```
5453

5554
## VoxelGrid
@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
6059
import torch
6160
from torch_cluster import grid_cluster
6261

63-
pos = torch.Tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
64-
size = torch.Tensor([5, 5])
62+
pos = torch.tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
63+
size = torch.tensor([5, 5])
6564

6665
cluster = grid_cluster(pos, size)
6766
```
6867

6968
```
7069
print(cluster)
71-
0 5 3 0 1
72-
[torch.LongTensor of size 5]
70+
tensor([ 0, 5, 3, 0, 1])
7371
```
7472

7573
## Running tests

0 commit comments

Comments
 (0)