Skip to content

Commit

Permalink
[Docs] Fix sampling tutorials (dmlc#3683)
Browse files Browse the repository at this point in the history
  • Loading branch information
VoVAllen authored Jan 26, 2022
1 parent 02e4cd8 commit 069dc45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/guide/minibatch-custom-sampler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 069dc45

Please sign in to comment.