Skip to content

[Paddle-TRT]Support argsort by TopK #66811

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

Merged
merged 8 commits into from
Aug 7, 2024
Merged

Conversation

ckl117
Copy link
Contributor

@ckl117 ckl117 commented Jul 30, 2024

PR Category

Inference

PR Types

Others

Description

Pcard-71500
When the number of items to be sorted is less than or equal to 3840, use ITopKLayer to implement argsort.

Copy link

paddle-bot bot commented Jul 30, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

}

auto* layer = TRT_ENGINE_ADD_LAYER(
engine_, TopK, *input_tensor, operation, 0, 1 << axis);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k的默认值设置为1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

if (axis < 0) {
axis += shape.size();
}
if (shape[axis] > 3840) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

动态shape这里只能获取到-1,建议不进trt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ming1753 ming1753 merged commit 34e2654 into PaddlePaddle:develop Aug 7, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants