Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
069dc45d
Unverified
Commit
069dc45d
authored
Jan 26, 2022
by
Jinjing Zhou
Committed by
GitHub
Jan 26, 2022
Browse files
[Docs] Fix sampling tutorials (#3683)
Fix #3626
parent
02e4cd8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/guide/minibatch-custom-sampler.rst
docs/source/guide/minibatch-custom-sampler.rst
+1
-1
No files found.
docs/source/guide/minibatch-custom-sampler.rst
View file @
069dc45d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment