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

[PDPD]Added and fixed Paddle convert. #28347

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bukejiyu
Copy link

@bukejiyu bukejiyu commented Jan 9, 2025

Details:

  1. added proto::AttrType::SCALARS
  2. support 0D inputs and fixes:
  1. Added convert:

Tickets:

@bukejiyu bukejiyu requested a review from a team as a code owner January 9, 2025 13:33
@github-actions github-actions bot added the category: PDPD FE OpenVINO PaddlePaddle FrontEnd label Jan 9, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Jan 9, 2025
@yuxu42
Copy link
Contributor

yuxu42 commented Jan 10, 2025

build_jenkins

@yuxu42
Copy link
Contributor

yuxu42 commented Jan 10, 2025

Hi @ceciliapeng2011 Could you please take a review? Thanks!

#include "default_opset.hpp"
#include "openvino/frontend/paddle/node_context.hpp"
#include "openvino/opsets/opset15.hpp"
#include "openvino/opsets/opset4.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

opset15 is back compatible to previous opsets. We can keep only opset15 header here.

void normalize(std::vector<int64_t>& vec, const Output<Node> intput, const std::vector<int64_t> axes_vec) {
for (size_t i = 0; i < axes_vec.size(); i++) {
if (vec[i] < 0) {
auto x_dim = std::stoll(intput.get_partial_shape()[axes_vec[i]].to_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simply use
auto x_dim = intput.get_partial_shape()[axes_vec[i]];
here?

for (int64_t i : vec) {
if (i < 0)
return true;
void normalize(std::vector<int64_t>& vec, const Output<Node> intput, const std::vector<int64_t> axes_vec) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void normalize(std::vector<int64_t>& vec, const Output<Node> intput, const std::vector<int64_t> axes_vec) {
void normalize(std::vector<int64_t>& vec, const Output<Node> input, const std::vector<int64_t> axes_vec) {

return res;
}

Output<Node> get_1d_tensor(const Output<Node>& node) {
Copy link
Contributor

@ceciliapeng2011 ceciliapeng2011 Jan 13, 2025

Choose a reason for hiding this comment

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

Do you meet any problem here without inserting unsqueeze node when node_dim == 0? OpenVINO supports scalar (rank==0).

return res;
}

Output<Node> get_1d_tensor(const Output<Node>& node) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The name "get_1d_tensor" sounds a bit mis-leading - it does not turn any tensor to 1D, right?Suggest change to something like "get_tensor_safe".

Copy link
Contributor

@ceciliapeng2011 ceciliapeng2011 left a comment

Choose a reason for hiding this comment

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

LGTM. Leave some minor comments.

@yuxu42
Copy link
Contributor

yuxu42 commented Jan 17, 2025

build_jenkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: PDPD FE OpenVINO PaddlePaddle FrontEnd ExternalPR External contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants