-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add partial_sum and partial_concat support #791
Conversation
yeliang2258
commented
Jul 1, 2022
•
edited
edited
- Add partial_sum and partial_concat support
if (in.Rank() != 2) { | ||
Error() << "The input dim of partial_sum OP must be 2." << std::endl; | ||
return -1; | ||
} |
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.
这个提示“The input dim of partial_sum OP must be 2.”
如果是Paddle要求只能为2,则是这个提示;
如果是Paddle2ONNX只能支持为2,则提示为Error() << Only support input with rank = 2, but now rank of input is " << in.Rank() << std::endl;
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.
Paddle要求只能为2
} | ||
int64_t batch_size = input_info[0].shape[0]; | ||
int64_t max_length = input_info[0].shape[1]; | ||
for (auto in : input_info) { |
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 (in.shape[0] != batch_size || in.shape[1] != max_length) { | ||
Error() | ||
<< "The batch_size and max_length of all inputs must be same in " + | ||
OpType() + " OP." |
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 (max_length < start_index_) { | ||
Error() << "start_index must be less than input len in " + OpType() + " OP." | ||
<< std::endl; |
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.
同上提示