-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[QNN] Support CallNode inputs in qnn.concatenate #5360
Conversation
I would suggest we add a unit test for this case. |
Is there somewhere that QnnCanonicalize is tested where I can add a test? |
You can add it here - tests/python/relay/test_op_qnn_concatenate.py |
I'm finding it difficult to test this case because in the Python API for qnn.concatenate the data value is expected to be a tuple (not a tuple-type call). Do you think it makes sense to relax this requirement in the Python API and let it fail in C++ instead? |
467346f
to
9567256
Compare
@anijain2305 @zhiics could you take a look at the changes I've made and see if this is now OK? |
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. Thanks for adding the test.
Currently, qnn.concatenate assumes that its 1st arg (data) is a TupleNode. This may not necessarily be true if the input is a CallNode which returns a value of tuple-type. This patch handles the CallNode case by inserting TupleGetItemNodes.
Change-Id: I731a231113c5214528373ef52b603a9f05ec502a
Change-Id: Ib3495532f6e4feb5aae3d3096cedd4dc4676cdb4
Change-Id: Id8123ea2dd9ce3d8267609de7b5602bb84b084fb
@zhiics @anijain2305 could you take another look at this please? |
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.
Only a small nitpick
* [QNN] Support CallNode inputs in qnn.concatenate Currently, qnn.concatenate assumes that its 1st arg (data) is a TupleNode. This may not necessarily be true if the input is a CallNode which returns a value of tuple-type. This patch handles the CallNode case by inserting TupleGetItemNodes. * Fix lint * Add test Change-Id: I40b55517b8b1dabbeca89337f80c0c8e62e34981 * Use isinstance Change-Id: I731a231113c5214528373ef52b603a9f05ec502a * isinstance fix Change-Id: Ib3495532f6e4feb5aae3d3096cedd4dc4676cdb4 * Use elif/else if Change-Id: Id8123ea2dd9ce3d8267609de7b5602bb84b084fb * Fix lint Change-Id: Ib6899bb22260575aa3f5d8b51b5d2a0277ee2b10 * Lint fix Change-Id: I56cf1930315344e42d956818a6c68e80836ae786 * Spaces Change-Id: I3edab192e32bafa9ffdc915315791c63279d85dc
* [QNN] Support CallNode inputs in qnn.concatenate Currently, qnn.concatenate assumes that its 1st arg (data) is a TupleNode. This may not necessarily be true if the input is a CallNode which returns a value of tuple-type. This patch handles the CallNode case by inserting TupleGetItemNodes. * Fix lint * Add test Change-Id: I40b55517b8b1dabbeca89337f80c0c8e62e34981 * Use isinstance Change-Id: I731a231113c5214528373ef52b603a9f05ec502a * isinstance fix Change-Id: Ib3495532f6e4feb5aae3d3096cedd4dc4676cdb4 * Use elif/else if Change-Id: Id8123ea2dd9ce3d8267609de7b5602bb84b084fb * Fix lint Change-Id: Ib6899bb22260575aa3f5d8b51b5d2a0277ee2b10 * Lint fix Change-Id: I56cf1930315344e42d956818a6c68e80836ae786 * Spaces Change-Id: I3edab192e32bafa9ffdc915315791c63279d85dc
* [QNN] Support CallNode inputs in qnn.concatenate Currently, qnn.concatenate assumes that its 1st arg (data) is a TupleNode. This may not necessarily be true if the input is a CallNode which returns a value of tuple-type. This patch handles the CallNode case by inserting TupleGetItemNodes. * Fix lint * Add test Change-Id: I40b55517b8b1dabbeca89337f80c0c8e62e34981 * Use isinstance Change-Id: I731a231113c5214528373ef52b603a9f05ec502a * isinstance fix Change-Id: Ib3495532f6e4feb5aae3d3096cedd4dc4676cdb4 * Use elif/else if Change-Id: Id8123ea2dd9ce3d8267609de7b5602bb84b084fb * Fix lint Change-Id: Ib6899bb22260575aa3f5d8b51b5d2a0277ee2b10 * Lint fix Change-Id: I56cf1930315344e42d956818a6c68e80836ae786 * Spaces Change-Id: I3edab192e32bafa9ffdc915315791c63279d85dc
Currently, qnn.concatenate assumes that its 1st arg (data) is a TupleNode. This may not necessarily be true if the input is a CallNode which returns a value of tuple-type. This patch handles the CallNode case by inserting TupleGetItemNodes.