Imported from https://github.com/ANLGBOY/MADE-Masked-Autoencoder-for-Distribution-Estimation-using-PyTorch