Count the parameters of nn.Linear(512, 256) with a bias.
nn.Linear(512, 256)
Answer: 131328
Weights 512 × 256 = 131,072 plus one bias per output: 256. Total 131,328.