$ ./guess_the_languageAI & ML
AI & ML · hard · #49

What is out.shape?

x = torch.randn(1, 3, 32, 32)
conv = nn.Conv2d(3, 16, kernel_size=5)  # stride 1, no padding
out = conv(x)
  1. (1, 16, 28, 28)
  2. (1, 16, 32, 32)
  3. (1, 3, 28, 28)
  4. (1, 16, 30, 30)
Output size = (32 - 5) / 1 + 1 = 28, with 16 output channels.
Play AI & ML ▸