In what order torch_geometric x features are assigned to edge_index

19 Views Asked by At

I want to assign the [1, 2, 3, 4] features that I created in x in torch_geometric to the unordered [5, 1, 3, 9] nodes that I created in edge_index as below code. It is not clear to which node this assignment is assigned, which feature is assigned to which node, this assignment may be assigned to [1 2 3 4] features [1, 3, 5, 9] drops. or [1, 2, 3, 4] features may be assigned according to the order of [5, 1, 3, 9] nodes, how can I see this as print.

import torch from torch_geometric.data import Data

x = torch.tensor([[1.0], [3.0], [3.0], [4.0]], dtype=torch.float)

edge_index = torch.tensor([[5, 1, 1, 3, 9, 3], [1, 5, 9, 1, 3, 9]], dtype=torch.long)

data = Data(x=x, edge_index=edge_index)

my question [1 2 3 4] features [1, 3, 5, 9] nodes or [1, 2, 3, 4] features [5, 1, 3, 9] nodes

0

There are 0 best solutions below