When we are constructing the network module, how can we determine the input size for fully connected layer after CNN blocks? Should we manually compute the final size after CNN blocks?
if you don’t want to calculate, you can do this experimentally by printing out the size of the tensor you want to feed to the Linear, do a test run and then do it again.
More philosophically, pytorch does not ask you to specify the input size. You pay for the liberty to pass any size items to your conv layers by not having pytorch tell you the output size. What you save is the bureaucracy between you and the actual calculation that intermediate frameworks bring with them to make this easier.