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

Add partial_sum and partial_concat support #791

Merged
merged 4 commits into from
Jul 4, 2022

Conversation

yeliang2258
Copy link
Collaborator

@yeliang2258 yeliang2258 commented Jul 1, 2022

  1. Add partial_sum and partial_concat support

@yeliang2258 yeliang2258 changed the title Add partial_sum op support Add partial_sum and partial_concat support Jul 1, 2022
paddle2onnx/mapper/tensor/partial_ops.cc Outdated Show resolved Hide resolved
if (in.Rank() != 2) {
Error() << "The input dim of partial_sum OP must be 2." << std::endl;
return -1;
}
Copy link
Collaborator

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;

Copy link
Collaborator Author

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) {
Copy link
Collaborator

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."
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上提示

paddle2onnx/mapper/tensor/partial_ops.cc Outdated Show resolved Hide resolved
paddle2onnx/mapper/tensor/partial_ops.h Outdated Show resolved Hide resolved
@yeliang2258 yeliang2258 merged commit 095a2f1 into PaddlePaddle:develop Jul 4, 2022
@yeliang2258 yeliang2258 deleted the partial_sum_dev branch September 1, 2022 02:05
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.

None yet

2 participants