I do not remember the details of Theano’s memory layout, but I am assuming it uses the NCHW format, which means your input dimensions (10, 1, 20, 224) corresponds to

batch size of 10,
channel depth of 1,
image height of 20 pixels,
image width of 224 pixels.

(The image height of 20 pixels does seem a bit odd to me – 224 would be more typical – but I am assuming it is correct. Change the examples below if it is incorrect.)
Under these assumptions, you do not need to change your declaration of fc1. That layer expects an input tensor with dimensions [None, 20 * 224] and will output a tensor with dimensions [None, 20].
The flattening operation will ensure that an input tensor with dimensions [None, 1, 224, 20] is transformed into a tensor with dimensions [None, 1 * 20 * 224], which is exactly the same as layer fc1 expects.
Note that if you switch from images with 1 channel to e.g. 3 channels (RGB), you will need to update your definition of fc1 accordingly, but you will not need to change the torch.flatten operation.