Skip to content

Commit 32fa325

Browse files
committed
float tensor [ci skip]
1 parent 1ef1a33 commit 32fa325

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ from torch_cluster import graclus_cluster
107107

108108
row = torch.tensor([0, 1, 1, 2])
109109
col = torch.tensor([1, 0, 2, 1])
110-
weight = torch.Tensor([1, 1, 1, 1]) # Optional edge weights.
110+
weight = torch.tensor([1., 1., 1., 1.]) # Optional edge weights.
111111

112112
cluster = graclus_cluster(row, col, weight)
113113
```
@@ -125,7 +125,7 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
125125
import torch
126126
from torch_cluster import grid_cluster
127127

128-
pos = torch.Tensor([[0, 0], [11, 9], [2, 8], [2, 2], [8, 3]])
128+
pos = torch.tensor([[0., 0.], [11., 9.], [2., 8.], [2., 2.], [8., 3.]])
129129
size = torch.Tensor([5, 5])
130130

131131
cluster = grid_cluster(pos, size)
@@ -144,7 +144,7 @@ A sampling algorithm, which iteratively samples the most distant point with rega
144144
import torch
145145
from torch_cluster import fps
146146

147-
x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
147+
x = torch.tensor([[-1., -1.], [-1., 1.], [1., -1.], [1., 1.]])
148148
batch = torch.tensor([0, 0, 0, 0])
149149
index = fps(x, batch, ratio=0.5, random_start=False)
150150
```
@@ -162,7 +162,7 @@ Computes graph edges to the nearest *k* points.
162162
import torch
163163
from torch_cluster import knn_graph
164164

165-
x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
165+
x = torch.tensor([[-1., -1.], [-1., 1.], [1., -1.], [1., 1.]])
166166
batch = torch.tensor([0, 0, 0, 0])
167167
edge_index = knn_graph(x, k=2, batch=batch, loop=False)
168168
```
@@ -181,7 +181,7 @@ Computes graph edges to all points within a given distance.
181181
import torch
182182
from torch_cluster import radius_graph
183183

184-
x = torch.Tensor([[-1, -1], [-1, 1], [1, -1], [1, 1]])
184+
x = torch.tensor([[-1., -1.], [-1., 1.], [1., -1.], [1., 1.]])
185185
batch = torch.tensor([0, 0, 0, 0])
186186
edge_index = radius_graph(x, r=1.5, batch=batch, loop=False)
187187
```

0 commit comments

Comments
 (0)