-
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
[Prim][PIR] Support dynamic shape for concat_grad #65148
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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
for (int i = 0; i < x_num; ++i) { | ||
sections.push_back(x[i].dims()[axis_value]); | ||
std::vector<Tensor> x_grad_tmp; | ||
if (has_dynamic_shape(x[0].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.
这个地方逻辑不够完善,下一个pr完善一下,并补充相关单侧。
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.
- 拆解逻辑这块是指对vector x中的每个tensor都要进行动态shape的判断么?
- 补充单侧的输入一部分tensor是静态shape,一部分tensor是动态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.
是的,可能存在这样的情况
if (has_dynamic_shape(x[0].shape())) { | ||
std::vector<Tensor> sections; | ||
for (int i = 0; i < x_num; i++) { | ||
sections.push_back(slice<T>(shape<T>(x[i]), |
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.
前向拆解里封装了get_slice接口,建议这里复用
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.
OK,下个PR一起修改
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
* support dynamic shape for cocnat_grad and add the dynamic shape test for split_grad * fix the bug in detail.h and the test case * add the allow_dynamic_shape
PR Category
Operator Mechanism
PR Types
New features
Description
为concat_grad添加动态shape支持,添加split_grad动态shape的单测