Skip to content

Commit 2b374aa

Browse files
committed
finally fixed n2v bug
1 parent 8fb8f0e commit 2b374aa

File tree

4 files changed

+17994
-2
lines changed

4 files changed

+17994
-2
lines changed

csrgraph/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self, data, nodenames=None, copy=True, threads=0):
8080
else:
8181
self.names = nodenames
8282
# NetworkX Graph input
83-
elif isinstance(data, nx.Graph):
83+
elif isinstance(data, (nx.Graph, nx.DiGraph)):
8484
mat = nx.adj_matrix(data)
8585
mat.data = mat.data.astype(np.float32)
8686
self.mat = mat

csrgraph/random_walks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ def _node2vec_walks(Tdata, Tindptr, Tindices,
188188
return_weight, neighbor_weight
189189
)
190190
# Write final states
191-
res[i, k] = state
191+
res[i, -1] = state
192192
return res
193193

194+
194195
@jit(nopython=True)
195196
def graph_from_walks_inner(walks):
196197
"""

0 commit comments

Comments
 (0)