-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
【PaddlePaddle Hackathon 3】Add Paddle where_index operator #12437
【PaddlePaddle Hackathon 3】Add Paddle where_index operator #12437
Conversation
src/core/tests/frontend/paddle/test_models/gen_scripts/generate_where_index.py
Show resolved
Hide resolved
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.
Hi Thanks for your contribution
src/core/tests/frontend/paddle/test_models/gen_scripts/generate_where_index.py
Show resolved
Hide resolved
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.
Hi, @Asthestarsfalll : thanks for contribution of this Paddle OP conversion. Have added some suggestions for rank 1 and Boolean type test case coverage. Other parts looks good to me.
src/core/tests/frontend/paddle/test_models/gen_scripts/generate_where_index.py
Outdated
Show resolved
Hide resolved
src/core/tests/frontend/paddle/test_models/gen_scripts/generate_where_index.py
Show resolved
Hide resolved
src/core/tests/frontend/paddle/test_models/gen_scripts/generate_where_index.py
Show resolved
Hide resolved
Hi, @ceciliapeng2011 : do you have any other comments about this PR? if none, could you please help merge it? tks. |
from save_model import saveModel | ||
import sys | ||
import paddle | ||
from paddle.fluid.layer_helper import LayerHelper |
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.
Can you use paddle 2.1 api instead of fluid which is obsolete after paddle 1.8 to build unit tests?
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.
done.
But there is a little diference between paddle.nonzero
and where_index
.
With the parameter as_tuple=True
, paddle.nonzero
will convert the output to tuple.
Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
Details:
add where_index operation in Paddle front end
Reference:
https://github.com/PaddlePaddle/Paddle2ONNX/blob/7e6ce45ebb4c108d7b602abb1858e2218f559b00/paddle2onnx/legacy/op_mapper/search.py
https://github.com/openvinotoolkit/openvino/blob/master/docs/ops/condition/NonZero_3.md
Not find document of where_index
uni-test passed