Bug: relabel_nodes=False in .subgraph() does not work correctly
- Dominant language
- Python
- Stars
- 14.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug
I am using SAINTSampler to get the subgraph,But I don't want to relabel the node id.I set \
`sg = g.subgraph(
node_ids, relabel_nodes=False, output_device=self.output_device
)`
And the sampler failed to sample correct nodes.

## To Reproduce
Steps to reproduce the behavior:
1.Chang the sample function in `graphsaint.py` to

2.Use SAINTSampler to sampler the
```python
g = dgl.data.CoraGraphDataset()[0]
sampler = SAINTSampler(mode="walk",budget=(10,10))
data_loader = dgl.dataloading.DataLoader(g,torch.arange(g.number_of_nodes()),sampler,
batch_size=batch_size,shuffle=True,drop_last=False,num_workers=4)
for epoch in range(num_epoches):
for subg in data_loader:
print(subg.nodes())
```
3.And result of the sampler is

## Expected behavior
The sampler result should be the original node id.But the sampler samples the whole node of the graph.
The correct result should be:

## Environment
- DGL Version (1.1.2+cu117):
- Backend Library & Version (PyTorch 1.13.0+cu117):
- OS ( Linux):
- How you installed DGL (pip):
- Python version:(3.8.17)
- CUDA/cuDNN version (cuda 11.7):
- GPU models and configuration (V100):
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.