You are missing the flatten operation in this line of code 18 if you call all modules in a sequential way.



 Muyun99:

And i also want to know what people would do when they need to test the input and output of the cnn.


One approach is to use forward hooks to get the output without manipulating the forward method.