-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Paddle Inference] Add fill_any_like trt converter. #47974
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
return false; | ||
} | ||
int dtype = PADDLE_GET_CONST(int, desc.GetAttr("dtype")); | ||
if (dtype != 2 && dtype != 5) { |
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.
framework::proto::VarType::INT32换这种写法?
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.
同意,使用 auto dtype = static_cast<framework::proto::VarType::Type>( PADDLE_GET_CONST(int, op_desc.GetAttr("dtype")));
转换成framework::proto::VarType::INT32
,可读性更好
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.
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); |
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.
我理解这个过程应该就是把一个shape为(1,)的tensor,reshape成(1,1,1,,,,)(nbDims_num个1)这样的形式,nbDims_num在组网过程中完全固定下来,能否改成不用setInput(1, *input_shape_tensor);这样的形式,直接改成setReshapeDimensions。
PR types
Others
PR changes
Others
Describe
fill_any_like trt converter only support int32 float32