Without knowing what exactly you’re trying to learn, it’s basically impossible to tell for sure what is off. Also, how does your input x look like, i.e., what is the kind of data and what is its shape. At the moment I can only make the vaguely informed guess that your view() commands cause the problem. Any need for something like x.view(batch_size, ...) should not be needed and only does the right thing by chance.
Debugging neural nets can be tricky:


Errors are only most commonly thrown when the shapes do not match the expected input. This is the easy case since, well, nothing works 


If there are no errors but the network is not training, i.e., the loss is not going down, then there can be many issues, but at east there’s an indicator that something is wrong.


However, even if the loss does goes down doesn’t mean that the training is done correctly!!! The network only looks for pattern which it can fined even in messed up data/batches. And this can easily happen when using view() or reshape() when one is not being careful.


I would almost betting 5 bucks that your network that is learning something, is still not necessarily learning correctly. But again, without knowing what you’re trying to do and what your input x looks like, it’s impossible to tell for sure.
For both networks can you change your forward methods to:
def forward(self, x):
    print(x.shape)
    x = x.view(...)
    print(x.shape)
    ...

and report the output of the print statements? Also, what do the dimensions of the input x mean?