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
03406bd9
Unverified
Commit
03406bd9
authored
Oct 23, 2023
by
Rhett Ying
Committed by
GitHub
Oct 23, 2023
Browse files
[GraphBolt] call from_csc with explicit key word arguments (#6485)
parent
13c754c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
python/dgl/graphbolt/impl/csc_sampling_graph.py
python/dgl/graphbolt/impl/csc_sampling_graph.py
+5
-2
tests/python/pytorch/graphbolt/impl/test_csc_sampling_graph.py
.../python/pytorch/graphbolt/impl/test_csc_sampling_graph.py
+8
-8
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
+6
-1
No files found.
python/dgl/graphbolt/impl/csc_sampling_graph.py
View file @
03406bd9
...
...
@@ -829,8 +829,11 @@ def from_csc(
>>> indices = torch.tensor([1, 3, 0, 1, 2, 0, 3])
>>> node_type_offset = torch.tensor([0, 1, 2, 3])
>>> type_per_edge = torch.tensor([0, 1, 0, 1, 1, 0, 0])
>>> graph = graphbolt.from_csc(csc_indptr, indices, node_type_offset,
\
>>> type_per_edge, None, metadata)
>>> graph = graphbolt.from_csc(csc_indptr, indices,
... node_type_offset=node_type_offset,
... type_per_edge=type_per_edge,
... edge_attributes=None, metadata=metadata)
None, metadata)
>>> print(graph)
CSCSamplingGraph(csc_indptr=tensor([0, 2, 5, 7]),
indices=tensor([1, 3, 0, 1, 2, 0, 3]),
...
...
tests/python/pytorch/graphbolt/impl/test_csc_sampling_graph.py
View file @
03406bd9
...
...
@@ -1130,10 +1130,10 @@ def test_hetero_graph_on_shared_memory(
graph
=
gb
.
from_csc
(
csc_indptr
,
indices
,
node_type_offset
,
type_per_edge
,
edge_attributes
,
metadata
,
node_type_offset
=
node_type_offset
,
type_per_edge
=
type_per_edge
,
edge_attributes
=
edge_attributes
,
metadata
=
metadata
,
)
shm_name
=
"test_hetero_g"
...
...
@@ -1253,10 +1253,10 @@ def test_multiprocessing_with_shared_memory():
graph
=
gb
.
from_csc
(
csc_indptr
,
indices
,
node_type_offset
,
type_per_edge
,
None
,
metadata
,
node_type_offset
=
node_type_offset
,
type_per_edge
=
type_per_edge
,
edge_attributes
=
None
,
metadata
=
metadata
,
)
ctx
=
mp
.
get_context
(
"spawn"
)
# Use spawn method.
...
...
tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py
View file @
03406bd9
...
...
@@ -1823,7 +1823,12 @@ def test_OnDiskDataset_all_nodes_set_hetero():
metadata
,
)
=
gbt
.
random_hetero_graph
(
1000
,
10
*
1000
,
3
,
4
)
graph
=
gb
.
from_csc
(
csc_indptr
,
indices
,
node_type_offset
,
type_per_edge
,
None
,
metadata
csc_indptr
,
indices
,
node_type_offset
=
node_type_offset
,
type_per_edge
=
type_per_edge
,
edge_attributes
=
None
,
metadata
=
metadata
,
)
with
tempfile
.
TemporaryDirectory
()
as
test_dir
:
...
...
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