snip3r77:

I don’t quite understand how to do this.


You would add print(x.shape) statements into the forward method to all places, where you don’t know the activation shape or don’t want to calculate it manually for the current input shape.
The num_flatten_features don’t avoid calculating the in_features as 16*6*6, but help you to flatten the tensor. I would still recommend to use x.view(x.size(0), -1).