PyTorch implementation of masked convolution used by PixelCNN from Oord et al. Pixel Recurrent Neural Networks. Samples from the model after 25 epochs: