-
Notifications
You must be signed in to change notification settings - Fork 682
[Unitest]Add unitest of Attention Layer #4494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for your contribution! |
|
K11OntheBoat seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
tests/layers/test_attention_layer.py
Outdated
| # =================================================================== | ||
| # 修改后的 Ernie4_5_Attention 类 | ||
| # =================================================================== | ||
| class Ernie4_5_Attention(nn.Layer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议直接引用组网里面的 import fastdeploy/model_executor/models/ernie4_5_moe.py 里面的 Ernie4_5_Attention ,减少代码量
tests/layers/test_attention_layer.py
Outdated
| from fastdeploy.model_executor.layers.rotary_embedding import get_rope | ||
|
|
||
|
|
||
| def get_padding_offset(bsz, max_seq_len, seq_lens_this_time): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数可以完全复用
from fastdeploy.model_executor.pre_and_post_process import pre_process
57f780a to
4be330f
Compare
efd7944 to
9e464bb
Compare
9e464bb to
bc677cf
Compare
bc677cf to
d3807a7
Compare
Attention 模块单测