Skip to content

Commit 691691f

Browse files
committed
requires grad fix
1 parent 1edd387 commit 691691f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torch_cluster/graclus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def graclus_cluster(row, col, weight=None, num_nodes=None):
2020
>>> weight = torch.Tensor([1, 1, 1, 1])
2121
>>> cluster = graclus_cluster(row, col, weight)
2222
"""
23-
num_nodes = row.max() + 1 if num_nodes is None else num_nodes
23+
24+
num_nodes = row.max().item() + 1 if num_nodes is None else num_nodes
2425

2526
if row.is_cuda: # pragma: no cover
2627
row, col = sort_row(row, col)

0 commit comments

Comments
 (0)