Imported from https://github.com/akanimax/attn_gan_pytorch