Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Neighbor sampling with replacement returns node ID -1 for 0 degree nodes #1421

Closed
BarclayII opened this issue Apr 6, 2020 · 0 comments · Fixed by #1422
Closed

[BUG] Neighbor sampling with replacement returns node ID -1 for 0 degree nodes #1421

BarclayII opened this issue Apr 6, 2020 · 0 comments · Fixed by #1422
Assignees
Labels
bug:confirmed Something isn't working

Comments

@BarclayII
Copy link
Collaborator

🐛 Bug

See below

To Reproduce

g = dgl.graph([], num_nodes=5)
sg = dgl.sampling.sample_neighbors(g, torch.tensor([1, 2], dtype=torch.int64), 2, replace=True)
sg.all_edges()
# returns (tensor([-1, -1, -1, -1]), tensor([-1, -1, -1, -1]))

Expected behavior

Should return 0 edges instead.

@BarclayII BarclayII added the bug:confirmed Something isn't working label Apr 6, 2020
@BarclayII BarclayII self-assigned this Apr 6, 2020
BarclayII added a commit to BarclayII/dgl that referenced this issue Apr 6, 2020
@BarclayII BarclayII linked a pull request Apr 6, 2020 that will close this issue
BarclayII added a commit that referenced this issue Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant