Skip to content
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

[Paddle Inference] Add fill_any_like trt converter. #47974

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

xiaoxiaohehe001
Copy link
Contributor

@xiaoxiaohehe001 xiaoxiaohehe001 commented Nov 14, 2022

PR types

Others

PR changes

Others

Describe

fill_any_like trt converter only support int32 float32

@paddle-bot
Copy link

paddle-bot bot commented Nov 14, 2022

你的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.

return false;
}
int dtype = PADDLE_GET_CONST(int, desc.GetAttr("dtype"));
if (dtype != 2 && dtype != 5) {
Copy link
Contributor

Choose a reason for hiding this comment

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

framework::proto::VarType::INT32换这种写法?

Copy link
Contributor

Choose a reason for hiding this comment

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

同意,使用 auto dtype = static_cast<framework::proto::VarType::Type>( PADDLE_GET_CONST(int, op_desc.GetAttr("dtype")));转换成framework::proto::VarType::INT32,可读性更好

Copy link
Contributor

Choose a reason for hiding this comment

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

type == -1也得考虑,根据输入设定

std::vector<int32_t>(nbDims_num, 1), output_name + "_one_rank_tensor_");
auto input_shape_tensor = one_rank_tensor;
auto* shuffle = TRT_ENGINE_ADD_LAYER(engine_, Shuffle, *value_tensor);
shuffle->setInput(1, *input_shape_tensor);
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,)的tensor,reshape成(1,1,1,,,,)(nbDims_num个1)这样的形式,nbDims_num在组网过程中完全固定下来,能否改成不用setInput(1, *input_shape_tensor);这样的形式,直接改成setReshapeDimensions。

@jiweibo jiweibo merged commit d6be900 into PaddlePaddle:develop Nov 16, 2022
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.

5 participants