Imported from https://github.com/StillKeepTry/Transformer-PyTorch