Commit 46f7e1e8 authored by bowendeng's avatar bowendeng
Browse files

fix the case where unweighted graph weight is a float within (0,1)

parent 363c29ad
...@@ -11,7 +11,7 @@ def metis_wgt(x): ...@@ -11,7 +11,7 @@ def metis_wgt(x):
diff = t1 - t2 diff = t1 - t2
diff = diff[diff != 0] diff = diff[diff != 0]
if len(diff) == 0: if len(diff) == 0:
return x.long() return torch.ones(x.shape, dtype=torch.long)
res = diff.abs().min() res = diff.abs().min()
bod = x.max() - x.min() bod = x.max() - x.min()
scale = (res / bod).item() scale = (res / bod).item()
......
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