pyg-team/pytorch_geometric

List node features can not be sliced with subgraph

Open

#6 162 ouverte le 7 déc. 2022

Voir sur GitHub
 (13 commentaires) (0 réactions) (0 assignés)Python (3 514 forks)batch import
0 - Priority P0featurehelp wanted

Métriques du dépôt

Stars
 (19 985 stars)
Métriques de merge PR
 (Merge moyen 35j 1h) (14 PRs mergées en 30 j)

Description

How to pass subgraph Data as a node feature into main graph Data? test_data=Data(edge_index=edge_index,pos=torch.tensor(np.array(pos)), graph=subgraphList) subgraphList is as follows:

 Data(x=[1, 3], edge_index=[2, 0], pos=[1, 2]),
 ...
 Data(x=[10, 3], edge_index=[2, 18])]```
The issue is that when I tried to mask some nodes:
`mask_test_data=test_data.subgraph(mask)`
mask_test_data.graph is the same as test_data.graph, while the size of mask_test_data.pos is reduced from test_data.pos.

After testing, I found the issue is caused by the type of list. May I know whether there is another type of container in which I can store the subgraph Data, and it can auto-align with  `test_data.subgraph(mask)`?

[Slack Message](https://torchgeometricco.slack.com/archives/C01DN0B3B1N/p1670346485240969?thread_ts=1670346485.240969&cid=C01DN0B3B1N)

Guide contributeur