Replies: 1 comment 6 replies
-
For heterogeneous graphs, you would do this per node type: for node_type in data.node_types:
data[node_type].n_id = torch.arange(data[node_type].num_nodes) |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I want to add the global node id in each batch (on heterogeneous graph) for some post analysis. I know
Data
object can easily do it by addingdata.n_id = torch.arange(data.num_nodes)
. I tried to add a dictionary by specifying different types of nodes, e.g.,Hetero_data.n_id = {"type1":torch.arange(Hetero_data.x_dict["type1"].shape[0]),"type2":...}
. In each batch, it has the all the original node ids instead of the ones only in this batch.Anyone has idea how to do it? Any suggestion is welcome, thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions