1 parent 6dabb04 commit b312d95Copy full SHA for b312d95
1 file changed
torch_cluster/graclus.py
@@ -51,6 +51,9 @@ def graclus_cluster(
51
row, col = row[perm], col[perm]
52
53
if weight is not None:
54
+ if (weight < 0).any().item():
55
+ raise ValueError(f"PyG's implementation of Graclus clustering "
56
+ f"does not support negative edge weights.")
57
weight = weight[perm]
58
59
deg = row.new_zeros(num_nodes)
0 commit comments