Ok, it worked when I tested with torch.squeeze, but yes in this case, torch.flatten(x, 1, 3) does the same thing i.e. it eliminates the dimensions of size 1.



 newbieatpytorch:

Also you have said that we use self.pool3(x) 2 times. Any specific reason for this.


    x = self.conv2(x)
    x = self.pool3(x)
    x = F.relu(x)
    x = self.conv3(x)
    x = self.pool3(x)

It does not change anything, but self.pool3 is used after self.conv2 which means that self.pool2 is never used, that’s all!