[API 2.0] Add transformer apis#26418
Merged
guoshengCS merged 22 commits intoPaddlePaddle:developfrom Aug 24, 2020
Merged
Conversation
test=develop
test=develop
test=develop
test=develop
test=develop
…arily. test=develop
test=develop
f4425cd to
0d01c16
Compare
XiaoguangHu01
previously approved these changes
Aug 22, 2020
| from .extension import * | ||
| from .activation import * | ||
| from .norm import * | ||
| from .transformer import * |
Contributor
There was a problem hiding this comment.
大写的组网类,在paddle.nn下建别名,推荐用paddle.nn.Transformer
|
|
||
| return (q, k, v) if cache is None else (q, k, v, cache) | ||
|
|
||
| def cal_kv(self, key, value): |
Contributor
There was a problem hiding this comment.
calculate 的缩写用 calc 更多些
Contributor
Author
There was a problem hiding this comment.
Done. Rename as compute_kv. Thanks
|
|
||
| return (q, k, v) if cache is None else (q, k, v, cache) | ||
|
|
||
| def cal_kv(self, key, value): |
Contributor
There was a problem hiding this comment.
这个API用户是否需要使用?如果需要的话,建议修改下。
calculate 的缩写用 calc 更多些,或者这里用compute也可以
Contributor
Author
There was a problem hiding this comment.
Done. Rename as compute_kv. Thanks
iclementine
reviewed
Aug 22, 2020
| import copy | ||
| import collections | ||
|
|
||
| import numpy as np |
…ording to comments. test=develop
48f97e1
raindrops2sea
approved these changes
Aug 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
New features
PR changes
APIs
Describe
Add transformer apis, as follows: