Skip to content
ml-recall

#edge-index

2 questions from Graph Neural Networks

Timed test

2 questions · 2 min · score and explanations at the end

Take a test
Q 1 / 2Score 0 / 0

Question 1: Short answer

mediumAI-checkedGraph Neural Networks

What is the second number printed?

import torch
from torch_geometric.data import Data

edge_index = torch.tensor([[0, 1, 1, 2, 2, 3],
                           [1, 0, 2, 1, 3, 2]])
x = torch.randn(4, 8)
data = Data(x=x, edge_index=edge_index)
print(data.num_nodes, data.num_edges)

a whole number