slice_batch tensor index
Open
feature request
- Dominant language
- Python
- Stars
- 14.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 🚀 Feature
Now we can use slice_batch to get a sample from a batched graph.
Get the 1-st graph:
```
g = dgl.slice_batch(bg, 1)
```
A more advanced idex slicing will be useful:
Get the 1,2,5-th graph and concate then as a new batched graph
```
g = dgl.slice_batch(bg, [1,2,5])
```
A possible work around is to do unbatch and batch again:
```
g = dgl.batch(dgl.unbatch(bg)[:5])
```
but I do think slicing should be a fundamental function in dgl library
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.