-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Hackathon NO.75] 为 Paddle-TRT 添加 expend_as_v2 算子 #51028
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
} | ||
} else if (op_type_ == "expand_as_v2") { | ||
if (inputs.find("Y") != inputs.end()) { | ||
shape_tensor = engine_->GetITensor(op_desc.Input("Shape")[0]); |
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.
这里是不是Y? 另外这个ci未覆盖
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.
是的,已修改
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.
PR-CI-Coverage这个CI还是没有过,这是什么原因呢
ops_config = [ | ||
{ | ||
"op_type": "expand_as_v2", | ||
"op_inputs": dics_intput[0], |
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.
这里只设置了一个输入,应该是两个
self.dynamic_shape.min_input_shape = { | ||
"expand_v2_input": [1, 8, 1, 32] | ||
} | ||
self.dynamic_shape.max_input_shape = { | ||
"expand_v2_input": [10, 8, 1, 32] | ||
} | ||
self.dynamic_shape.opt_input_shape = { | ||
"expand_v2_input": [1, 8, 1, 32] | ||
} |
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.
expand_shape也需要设置动态shape值
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.
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.
LGTM
请 @gzy19990617 解决下冲突 |
PR types
Others
PR changes
Others
Describe
expend_v2目前已经实现,因为expend_as_v2与expend_as_v2的input、attrs有些不同,expend_as_v2算子会调用expand_kernal.cu。
因此在expend_v2基础上完成了expend_as_v2,同时在op_converter.h中利用shuffle增加了ITensor Reshape的api,方便以后对ITensor进行reshape操作。
python测试了两种情况,一种是属性中有"target_shape",一种是输入含有Y(此时会优化用Y的shape去expand),输入的维度和shape的维度均进行了测试,覆盖多种情况,全部通过。