Unverified Commit e8ef55c7 authored by peizhou001's avatar peizhou001 Committed by GitHub
Browse files

[Graphbolt] Fix docstring (#5995)


Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-16-19.ap-northeast-1.compute.internal>
parent 807a753c
......@@ -14,13 +14,11 @@ class SampledSubgraphImpl(SampledSubgraph):
Examples
--------
>>> node_pairs = {('A', 'B', 'relation'): (torch.tensor([1, 2, 3]),
... torch.tensor([4, 5, 6]))}
>>> reverse_column_node_ids = {'A': torch.tensor([7, 8, 9]),
... 'B': torch.tensor([10, 11, 12])}
>>> reverse_row_node_ids = {'A': torch.tensor([13, 14, 15]),
... 'B': torch.tensor([16, 17, 18])}
>>> reverse_edge_ids = {('A', 'B', 'relation'): torch.tensor([19, 20, 21])}
>>> node_pairs = {('A', 'relation', 'B'): (torch.tensor([0, 1, 2]),
... torch.tensor([0, 1, 2]))}
>>> reverse_column_node_ids = {'B': torch.tensor([10, 11, 12])}
>>> reverse_row_node_ids = {'A': torch.tensor([13, 14, 15])}
>>> reverse_edge_ids = {('A', 'relation', 'B'): torch.tensor([19, 20, 21])}
>>> subgraph = gb.SampledSubgraphImpl(
... node_pairs=node_pairs,
... reverse_column_node_ids=reverse_column_node_ids,
......@@ -28,13 +26,13 @@ class SampledSubgraphImpl(SampledSubgraph):
... reverse_edge_ids=reverse_edge_ids
... )
>>> print(subgraph.node_pairs)
{('A', 'B', 'relation'): (tensor([1, 2, 3]), tensor([4, 5, 6]))}
{('A', 'relation', 'B'): (tensor([0, 1, 2]), tensor([0, 1, 2]))}
>>> print(subgraph.reverse_column_node_ids)
{'A': tensor([7, 8, 9]), 'B': tensor([10, 11, 12])}
{'B': tensor([10, 11, 12])}
>>> print(subgraph.reverse_row_node_ids)
{'A': tensor([13, 14, 15]), 'B': tensor([16, 17, 18])}
{'A': tensor([13, 14, 15])}
>>> print(subgraph.reverse_edge_ids)
{('A', 'B', 'relation'): tensor([19, 20, 21])}
{('A', 'relation', 'B'): tensor([19, 20, 21])}
"""
node_pairs: Union[
Dict[Tuple[str, str, str], Tuple[torch.Tensor, torch.Tensor]],
......
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