I am new to pytorch so will only be able to provide high level help. If you wish you can add a GlobalPooling layer just after the last layer to obtain (9,1). Or you can define the new layer in your init and bypass the FC(x) in the forward() method of your derived nn.Module class.