"...HugeCTR/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "f119ea7cadbb36cd005630c461f9baa7ad5af3bf"
Unverified Commit fc366945 authored by Xin Yao's avatar Xin Yao Committed by GitHub
Browse files

[Bug] Avoid importing packaging directly (#6260)


Signed-off-by: default avatarXin Yao <xiny@nvidia.com>
parent 4a42027d
...@@ -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 Version(scipy.__version__) < Version("1.11.0"): if version.parse(scipy.__version__) < version.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
......
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