gphilip:

X = torch.randn([256, 64, 28, 28])
Y = nn.Conv2d(64, 64, stride=2, padding=1, kernel_size=3)(X)
Z = nn.AdaptiveAvgPool2d(1)(Y)

print(Z.shape)



Thanks a lot, so is it wrong to pass
torch.Size([256, 64, 1, 1])
to a softmax(1)?

Screen Shot 2021-09-01 at 12.31.17 PM1348×568 47.1 KB

i am not getting any error but my accuracy has dropped significantly and it seems softmax is not working as expected hence thought maybe i should change the arg inside softmax from 1 to something else that I am not sure what it is.
a bit explanation here How to stack adaptiveavgpool2D and softmax?