Solved by Stefano_Setti in post #2 
              
              
                I just figured out how the flatten layer in PyTorch works, so basically as firs argument i need to express from where to start the flattening ad as second where to end it. Basically it should be: 
nn.Flatten(1, 3)