Question 1: Short answer
mediumAI-checkedAttention & TransformersThe feed-forward module of each GPT-2 small block (embedding size 768). What does the last line print?
emb_dim = 768
ff = nn.Sequential(
nn.Linear(emb_dim, 4 * emb_dim),
nn.GELU(approximate="tanh"),
nn.Linear(4 * emb_dim, emb_dim),
)
print(sum(p.numel() for p in ff.parameters()))