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

[converter] correct non-compliant axis handling in split and splitV ops #346

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

LynnL4
Copy link
Contributor

@LynnL4 LynnL4 commented Aug 8, 2024

Hi,
This PR fixes the axis input for the split and splitV operations to match TensorFlow's definition, which requires a 0-D int32 tensor. The previous implementation incorrectly used an array, causing some model converters to fail.

FYI
https://tensorflow.google.cn/api_docs/python/tf/raw_ops/Split
https://tensorflow.google.cn/api_docs/python/tf/raw_ops/SplitV

@CLAassistant
Copy link

CLAassistant commented Aug 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@peterjc123 peterjc123 left a comment

Choose a reason for hiding this comment

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

Thanks for your PR. Let's wait for the CI to finish

@peterjc123 peterjc123 changed the title [convert] correct non-compliant axis handling in split and splitV ops [converter] correct non-compliant axis handling in split and splitV ops Aug 8, 2024
@peterjc123
Copy link
Collaborator

According to the docs here, it seems that tfl.split_v needs a 0-d tensor as dim, but it doesn't to be mentioned for tfl.split.

@peterjc123
Copy link
Collaborator

@LynnL4 Yes, it looks like TFL core doesn't care about the shape of the dim tensor. We could adapt to 0-d tensors if other projects do this as well. Please fix the unit tests so that I can take the changes in.

@LynnL4
Copy link
Contributor Author

LynnL4 commented Aug 9, 2024

@LynnL4 Yes, it looks like TFL core doesn't care about the shape of the dim tensor. We could adapt to 0-d tensors if other projects do this as well. Please fix the unit tests so that I can take the changes in.

All I know is that the ST EDGE AI conversion tool has this limitation. Also on the arm vela conversion tool it converts fine whether it's 0-D or not.

@LynnL4
Copy link
Contributor Author

LynnL4 commented Aug 10, 2024

@peterjc123 Bugs have been fixed according to CI

@LynnL4 LynnL4 force-pushed the fix/converter-ops-split branch from fc40ed3 to 626a757 Compare August 10, 2024 03:48
@peterjc123 peterjc123 merged commit f6703c8 into alibaba:main Aug 12, 2024
9 checks passed
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.

3 participants