"vscode:/vscode.git/clone" did not exist on "3ad4207d1fb639af3a86d3fe5fc60406d1d7e9fe"
Unverified Commit 47c6fb1f authored by peizhou001's avatar peizhou001 Committed by GitHub
Browse files

[Graphbolt]Fix docstring example (#6328)

parent e3bf1c0e
......@@ -61,18 +61,15 @@ class NeighborSampler(SubgraphSampler):
>>> indptr = torch.LongTensor([0, 2, 4, 5, 6, 7 ,8])
>>> indices = torch.LongTensor([1, 2, 0, 3, 5, 4, 3, 5])
>>> graph = gb.from_csc(indptr, indices)
>>> data_format = gb.LinkPredictionEdgeFormat.INDEPENDENT
>>> node_pairs = torch.LongTensor([[0, 1], [1, 2]])
>>> item_set = gb.ItemSet(node_pairs, names="node_pairs")
>>> item_sampler = gb.ItemSampler(
...item_set, batch_size=1,
...)
>>> neg_sampler = gb.UniformNegativeSampler(
...item_sampler, 2, data_format, graph)
>>> fanouts = [torch.LongTensor([5]), torch.LongTensor([10]),
...torch.LongTensor([15])]
...item_sampler, graph, 2)
>>> subgraph_sampler = gb.NeighborSampler(
...neg_sampler, graph, fanouts)
...neg_sampler, graph, [5, 10, 15])
>>> for data in subgraph_sampler:
... print(data.compacted_node_pairs)
... print(len(data.sampled_subgraphs))
......
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