Yes, that’s what I do in my example.
Note that you can add a global operation (like global max/average pooling) just before your view layer, so that you know precisely the number of inputs that the linear layer will receive (as you can see in the resnet model definition 185, where the kernel size for the pooling can be computed on the fly using the functional interface).
We could eventually add another method to each Function that, given an input shape and a set of parameters, returns an output shape, but is it really worth it?
@apaszke what do you think?