Replies: 1 comment 2 replies
-
In PyG, we usually do this by converting edge indices into a single 1-dimensional index tensor, and then performing the filtering via index1 = edge_index_A[0] * num_nodes + edge_index_A[1]
index2 = edge_index_B[0] * num_nodes + edge_index_B[1]
mask = torch.isin(index1, index2) |
Beta Was this translation helpful? Give feedback.
2 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,
I have two graphs A and B. There might be some different edges between them. I wanna merge the edge features from A to B but drop out the edges that are not in B. So, I need to first check if an edge of A is in B. One possible way is as follows:
I think the above code is very inefficient, so look for a better one. Thank you.
Sway
Beta Was this translation helpful? Give feedback.
All reactions