Unverified Commit 65fdfad6 authored by Xin Yao's avatar Xin Yao Committed by GitHub
Browse files

[Doc] Fix the example code of negative sampler (#3501)


Co-authored-by: default avatarJinjing Zhou <VoVAllen@users.noreply.github.com>
parent b8ce0f41
...@@ -49,7 +49,7 @@ class Uniform(_BaseNegativeSampler): ...@@ -49,7 +49,7 @@ class Uniform(_BaseNegativeSampler):
-------- --------
>>> g = dgl.graph(([0, 1, 2], [1, 2, 3])) >>> g = dgl.graph(([0, 1, 2], [1, 2, 3]))
>>> neg_sampler = dgl.dataloading.negative_sampler.Uniform(2) >>> neg_sampler = dgl.dataloading.negative_sampler.Uniform(2)
>>> neg_sampler(g, [0, 1]) >>> neg_sampler(g, torch.tensor([0, 1]))
(tensor([0, 0, 1, 1]), tensor([1, 0, 2, 3])) (tensor([0, 0, 1, 1]), tensor([1, 0, 2, 3]))
""" """
def __init__(self, k): def __init__(self, k):
......
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