Skip to content
Discussion options

You must be logged in to vote

Some GNN operators have static graph support built-in, e.g., in GCNConv you can do:

x = [batch_size, num_nodes, num_features]
edge_index = [2, num_edges]  # Edge-connectivity of a single graph

out = GCNConv(...)(x, edge_index)
# out will have shape [batch_size, num_nodes, num_new_features]

To be even more memory-efficient, I suggest you to use the SparseTensor class for encoding edges, see here.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@mdanb
Comment options

Comment options

You must be logged in to vote
4 replies
@mdanb
Comment options

@rusty1s
Comment options

@mdanb
Comment options

@rusty1s
Comment options

Answer selected by mdanb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants