Solved by ptrblck in post #4 
              
              
                Your model returns three tensors in its forward method: 
return self.decode(z), mu, logvar

Assuming you would like to visualize the first returned tensor, this should work: 
o = out[0].view(out[0].size(0), -1)