Imported from https://github.com/wenguanwang/deepattention