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
dgl
Commits
fc366945
Unverified
Commit
fc366945
authored
Sep 01, 2023
by
Xin Yao
Committed by
GitHub
Sep 01, 2023
Browse files
[Bug] Avoid importing packaging directly (#6260)
Signed-off-by:
Xin Yao
<
xiny@nvidia.com
>
parent
4a42027d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
python/dgl/transforms/functional.py
python/dgl/transforms/functional.py
+3
-2
No files found.
python/dgl/transforms/functional.py
View file @
fc366945
...
@@ -22,7 +22,8 @@ from collections.abc import Iterable, Mapping
...
@@ -22,7 +22,8 @@ from collections.abc import Iterable, Mapping
import
numpy
as
np
import
numpy
as
np
import
scipy.sparse
as
sparse
import
scipy.sparse
as
sparse
import
scipy.sparse.linalg
import
scipy.sparse.linalg
from
packaging.version
import
Version
from
..utils
import
version
try
:
try
:
import
torch
as
th
import
torch
as
th
...
@@ -3592,7 +3593,7 @@ def random_walk_pe(g, k, eweight_name=None):
...
@@ -3592,7 +3593,7 @@ def random_walk_pe(g, k, eweight_name=None):
)
)
A
=
A
.
multiply
(
W
)
A
=
A
.
multiply
(
W
)
# 1-step transition probability
# 1-step transition probability
if
V
ersion
(
scipy
.
__version__
)
<
V
ersion
(
"1.11.0"
):
if
v
ersion
.
parse
(
scipy
.
__version__
)
<
v
ersion
.
parse
(
"1.11.0"
):
RW
=
np
.
array
(
A
/
(
A
.
sum
(
1
)
+
1e-30
))
RW
=
np
.
array
(
A
/
(
A
.
sum
(
1
)
+
1e-30
))
else
:
else
:
# Sparse matrix divided by a dense array returns a sparse matrix in
# Sparse matrix divided by a dense array returns a sparse matrix in
...
...
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