Unverified Commit 069dc45d authored by Jinjing Zhou's avatar Jinjing Zhou Committed by GitHub
Browse files

[Docs] Fix sampling tutorials (#3683)

Fix #3626
parent 02e4cd8b
......@@ -370,7 +370,7 @@ nodes with a probability, one can simply define the sampler as follows:
# Get all inbound edges to `seed_nodes`
src, dst = dgl.in_subgraph(g, seed_nodes).all_edges()
# Randomly select edges with a probability of p
mask = torch.zeros_like(src).bernoulli_(self.p)
mask = torch.zeros_like(src).bernoulli_(self.p).bool()
src = src[mask]
dst = dst[mask]
# Return a new graph with the same nodes as the original graph as a
......
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