The error seems very strange to me, in the documentation MSELoss expects the same dimension tensors. I made target the same exact thing as as the input, and the output is the same exact dimensions as the input as it is an autoencoder. Why would  MSELoss complain that the dimensions do not match?
Not that it practically matters, but as you mention the documentation perhaps there is some deeper problem–why does it say that there is a module nn.function.mse_loss, and when I try to assign the loss to this I get an error that nn.functional has no attribute ‘mse_loss’?