Unverified Commit 03406bd9 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[GraphBolt] call from_csc with explicit key word arguments (#6485)

parent 13c754c1
...@@ -829,8 +829,11 @@ def from_csc( ...@@ -829,8 +829,11 @@ def from_csc(
>>> indices = torch.tensor([1, 3, 0, 1, 2, 0, 3]) >>> indices = torch.tensor([1, 3, 0, 1, 2, 0, 3])
>>> node_type_offset = torch.tensor([0, 1, 2, 3]) >>> node_type_offset = torch.tensor([0, 1, 2, 3])
>>> type_per_edge = torch.tensor([0, 1, 0, 1, 1, 0, 0]) >>> type_per_edge = torch.tensor([0, 1, 0, 1, 1, 0, 0])
>>> graph = graphbolt.from_csc(csc_indptr, indices, node_type_offset, \ >>> graph = graphbolt.from_csc(csc_indptr, indices,
>>> type_per_edge, None, metadata) ... node_type_offset=node_type_offset,
... type_per_edge=type_per_edge,
... edge_attributes=None, metadata=metadata)
None, metadata)
>>> print(graph) >>> print(graph)
CSCSamplingGraph(csc_indptr=tensor([0, 2, 5, 7]), CSCSamplingGraph(csc_indptr=tensor([0, 2, 5, 7]),
indices=tensor([1, 3, 0, 1, 2, 0, 3]), indices=tensor([1, 3, 0, 1, 2, 0, 3]),
......
...@@ -1130,10 +1130,10 @@ def test_hetero_graph_on_shared_memory( ...@@ -1130,10 +1130,10 @@ def test_hetero_graph_on_shared_memory(
graph = gb.from_csc( graph = gb.from_csc(
csc_indptr, csc_indptr,
indices, indices,
node_type_offset, node_type_offset=node_type_offset,
type_per_edge, type_per_edge=type_per_edge,
edge_attributes, edge_attributes=edge_attributes,
metadata, metadata=metadata,
) )
shm_name = "test_hetero_g" shm_name = "test_hetero_g"
...@@ -1253,10 +1253,10 @@ def test_multiprocessing_with_shared_memory(): ...@@ -1253,10 +1253,10 @@ def test_multiprocessing_with_shared_memory():
graph = gb.from_csc( graph = gb.from_csc(
csc_indptr, csc_indptr,
indices, indices,
node_type_offset, node_type_offset=node_type_offset,
type_per_edge, type_per_edge=type_per_edge,
None, edge_attributes=None,
metadata, metadata=metadata,
) )
ctx = mp.get_context("spawn") # Use spawn method. ctx = mp.get_context("spawn") # Use spawn method.
......
...@@ -1823,7 +1823,12 @@ def test_OnDiskDataset_all_nodes_set_hetero(): ...@@ -1823,7 +1823,12 @@ def test_OnDiskDataset_all_nodes_set_hetero():
metadata, metadata,
) = gbt.random_hetero_graph(1000, 10 * 1000, 3, 4) ) = gbt.random_hetero_graph(1000, 10 * 1000, 3, 4)
graph = gb.from_csc( 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: with tempfile.TemporaryDirectory() as test_dir:
......
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