Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeprecationWarning]: Resolving warning: conversion of an array with ndim > 0 to a scalar. #7834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/dgl/data/tu.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def process(self):
int
)
)
self.num_labels = int(max(DS_graph_labels) + 1)
self.num_labels = int(max(DS_graph_labels)[0] + 1)
self.graph_labels = F.tensor(DS_graph_labels)
elif os.path.exists(self._file_path("graph_attributes")):
DS_graph_labels = loadtxt(
Expand Down
4 changes: 2 additions & 2 deletions python/dgl/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def networkx2tensor(nx_graph, idtype, edge_id_attr_name=None):
src = [0] * num_edges
dst = [0] * num_edges
for u, v, attr in nx_graph.edges(data=True):
eid = int(attr[edge_id_attr_name])
eid = int(attr[edge_id_attr_name][0])
if eid < 0 or eid >= nx_graph.number_of_edges():
raise DGLError(
"Expect edge IDs to be a non-negative integer smaller than {:d}, "
Expand Down Expand Up @@ -278,7 +278,7 @@ def networkxbipartite2tensors(
"Expect the node {} to have attribute bipartite=1 "
"with edge {}".format(v, (u, v))
)
eid = int(attr[edge_id_attr_name])
eid = int(attr[edge_id_attr_name][0])
if eid < 0 or eid >= nx_graph.number_of_edges():
raise DGLError(
"Expect edge IDs to be a non-negative integer smaller than {:d}, "
Expand Down
Loading