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

Use TFLite Interpreter's public instead of private API to get tensor details #2204

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

q-ycong-p
Copy link
Contributor

@q-ycong-p q-ycong-p commented Jul 12, 2023

TF-2.12.0 introduced API change that breaks tf2onnx UT tests on the tflite paths, due to the addition of compulsory subgraph arg to several function's input signature:
tensorflow/tensorflow@55d84d7

This commit changes tf2onnx functions that call to TFLite Interpreter class's private _get_tensor_details, to instead call its public API get_tensor_details. I think the code change is functionality-wise equivalent, from tf2onnx's usage perspective, and circumvent backward comp issue from using a private function.

#2154

…unbreak UT

TF-2.12.0 introduced API change that breaks tf2onnx UT tests on the
tflite paths, due to the addition of compulsory subgraph arg to several
function's input signature:
tensorflow/tensorflow@55d84d7

This commit is a temporary hotfix to unbreak related UT failure.
Existing tf2onnx's use cases get tflite Interpreter's tensors from model's
first subgraph only. The hotfix hard-codes subgraph index to `0` to
retain the same behavior while resolves API diff.

Signed-off-by: Yu Cong <congyc@amazon.com>
@q-ycong-p q-ycong-p changed the title Hotfix: Circumvent tf-2.12 breaking change on tflite subgraph API to unbreak UT Use TFLite Interpreter's public instead of private API to get tensor details Jul 13, 2023
@q-ycong-p
Copy link
Contributor Author

Some tests failed during environment setup independent to code diff. How can we rerun the tests without force push?

@yan12125
Copy link
Contributor

How can we rerun the tests without force push?

Close and reopen this PR should work.

@q-ycong-p q-ycong-p closed this Jul 19, 2023
@q-ycong-p q-ycong-p reopened this Jul 19, 2023
Copy link
Collaborator

@fatcat-z fatcat-z left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for your contribution!

@fatcat-z fatcat-z enabled auto-merge (squash) July 28, 2023 16:12
@fatcat-z fatcat-z merged commit 0152029 into onnx:main Jul 28, 2023
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