Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-sparse
Commits
46f7e1e8
Commit
46f7e1e8
authored
Apr 13, 2020
by
bowendeng
Browse files
fix the case where unweighted graph weight is a float within (0,1)
parent
363c29ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torch_sparse/metis.py
torch_sparse/metis.py
+1
-1
No files found.
torch_sparse/metis.py
View file @
46f7e1e8
...
...
@@ -11,7 +11,7 @@ def metis_wgt(x):
diff
=
t1
-
t2
diff
=
diff
[
diff
!=
0
]
if
len
(
diff
)
==
0
:
return
x
.
long
(
)
return
torch
.
ones
(
x
.
shape
,
dtype
=
torch
.
long
)
res
=
diff
.
abs
().
min
()
bod
=
x
.
max
()
-
x
.
min
()
scale
=
(
res
/
bod
).
item
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment