sample_neighbors() core dumps when sampling from unknown ids
Open
feature request
- Dominant language
- Python
- Stars
- 14.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug
`sample_neighbors()` core dumps instead of throwing exceptions when sampling from unknown ids. If unknown id is small, id=3, then sometimes exception are thrown. If unknown id=102012, it seem to always core.
## To Reproduce
```
import dgl
g = dgl.graph(([0, 0, 1, 1, 2, 2], [1, 2, 0, 1, 2, 0]))
sg = dgl.sampling.sample_neighbors(g, [3,102012], 1)
```
## Expected behavior
Throw exception instead of core dump
## Environment
- `dgl.__version__` = 0.8.2
- cpu
- OS: Linux
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.