When you define all the other modules, (conv/pool/etc), that defines the size that your last layer needs to take. It not unknown, it is just tricky to compute 
Note that you could also provide a dummy input to the init, run part of the model to get the size of the last layer.