The required input size of the linear layer depends on the input size that will be fed. If you have 16 channels and a 6*6 image as the comment suggests, that would be the size you need. If you feed smaller images, that would give you smaller inputs.
You can always try these things and you’ll get an error message giving you the right number (although not the calculation). Or you could just print x.shape before and after the `x = x.view(…)``line.
Best regards
Thomas