Hi,
Thanks for your reply! Where exactly do I need to put this?
If I replace
out = out.view(out.size(0), -1)

by
out = out .view(out .shape[0], out.shape[1], -1)

I still get a similar error:

shape ‘[12, 1, 28]’ is invalid for input of size 27648