Skip to content
ml-recall

#nn-sequential

1 question from PyTorch

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Short answer

mediumAI-checkedPyTorch

You want three independent 8→88 \to 8 linear layers in a row and write:

layer = nn.Linear(8, 8)
net = nn.Sequential(*[layer] * 3)
print(sum(p.numel() for p in net.parameters()))

What does the last line print?

a whole number