View size is not compatible with input tensor's - But it Does!

I’m trying to do a simple line:

        w = w.view(w.shape[0] * w.shape[2], w.shape[1], 1,1,1)

And I’m getting an error:

view size is not compatible with input tensor’s

Not only I checked a million times the sizes and that they are compatible, but it’s easy to see that the operation must be the same.

Is it because “view” is just looking at the memory differently? and maybe here he can’t? any Idea??


Could you post a code snippet to reproduce this error?

It’s hard it’s a big program, and it used to work before.
But I solved it using reshape.
Sorry for bothering.