Decoded output dimension not the same as the input in AutoEncoder

Based on your input shape and layer configs, you would need to set output_padding=1 in the first and third nn.ConvTranspose2d layer to get the same output shape for your input.