Solved by ptrblck in post #23 
              
              
                Ah sorry, my bad! I just added my batch size of 1 to the View() layer. 
You should change it to: 
encoder:
View((batch_size, -1))

decoder:
View((batch_size, -1, 3, 3))

Unfortunately, you cannot use x.size(0), since the layer is defined in a Sequential, so you have to know your batch size beforehan…