Imported from https://github.com/kngwyu/pytorch-autoencoders