Skip to content
Discussion options

You must be logged in to vote

Does that work for you?

import torch
num_nodes = 100
num_edges = 100
row = torch.randint(0, num_nodes, (num_edges,))
col = torch.randint(0, num_nodes, (num_edges,))
edge_index = torch.stack([row, col], dim=0)
edge_index = edge_index[:, row < col] # make directed

Replies: 1 comment 1 reply

Comment options

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

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