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
2df85862
"src/vscode:/vscode.git/clone" did not exist on "7974fad13bfcf65b9c342d526f91eb0937a030c7"
Unverified
Commit
2df85862
authored
Feb 20, 2024
by
Ramon Zhou
Committed by
GitHub
Feb 20, 2024
Browse files
[GraphBolt] Correct `to_pyg_data` (#7124)
parent
13cbad32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
python/dgl/graphbolt/minibatch.py
python/dgl/graphbolt/minibatch.py
+1
-1
tests/python/pytorch/graphbolt/test_minibatch.py
tests/python/pytorch/graphbolt/test_minibatch.py
+1
-1
No files found.
python/dgl/graphbolt/minibatch.py
View file @
2df85862
...
...
@@ -500,7 +500,7 @@ class MiniBatch:
col_nodes
=
torch
.
cat
(
col_nodes
)
row_nodes
=
torch
.
cat
(
row_nodes
)
edge_index
=
torch
.
unique
(
torch
.
stack
((
col
_nodes
,
row
_nodes
)),
dim
=
1
torch
.
stack
((
row
_nodes
,
col
_nodes
)),
dim
=
1
)
if
self
.
node_features
is
None
:
...
...
tests/python/pytorch/graphbolt/test_minibatch.py
View file @
2df85862
...
...
@@ -881,7 +881,7 @@ def test_to_pyg_data():
original_column_node_ids
=
torch
.
tensor
([
10
,
11
]),
)
expected_edge_index
=
torch
.
tensor
(
[[
0
,
0
,
1
,
1
,
1
,
2
,
2
,
3
],
[
0
,
1
,
0
,
1
,
2
,
1
,
2
,
2
]]
[[
0
,
0
,
1
,
1
,
1
,
2
,
2
,
2
],
[
0
,
1
,
0
,
1
,
2
,
1
,
2
,
3
]]
)
expected_node_features
=
torch
.
tensor
([[
1
],
[
2
],
[
3
],
[
4
]])
expected_labels
=
torch
.
tensor
([
0
,
1
])
...
...
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