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, 16, 28, 28)
- (1, 16, 32, 32)
- (1, 3, 28, 28)
- (1, 16, 30, 30)
Output size = (32 - 5) / 1 + 1 = 28, with 16 output channels.
Play AI & ML ▸