-
Notifications
You must be signed in to change notification settings - Fork 19.7k
[OpenVINO backend] Support numpy.diagonal #21952
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @Divyanshu-hash, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the OpenVINO backend for Keras 3 by introducing full support for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for numpy.diagonal to the OpenVINO backend. The implementation correctly uses transpose to align the axes before calling the backend's diagonal operation. The corresponding test is also enabled.
I have two main points of feedback:
- The axis normalization in
diagonalshould be improved to handle out-of-bounds axes correctly, consistent with NumPy's behavior and other functions in the backend. - The addition of
pytest.iniat the root level might unintentionally affect the entire test suite by setting the default backend to OpenVINO. This should be reviewed to ensure it doesn't break CI for other backends.
Overall, a good addition to improve OpenVINO backend coverage.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21952 +/- ##
==========================================
- Coverage 82.69% 78.67% -4.02%
==========================================
Files 588 588
Lines 61369 61413 +44
Branches 9612 9622 +10
==========================================
- Hits 50749 48318 -2431
- Misses 8135 10728 +2593
+ Partials 2485 2367 -118
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
76785df to
bd69a5e
Compare
What does this PR do?
This PR adds support for
numpy.diagonalin the OpenVINO backend for Keras 3 inference.The implementation decomposes
numpy.diagonalusing OpenVINO opset operations and enables the corresponding tests for the OpenVINO backend.What has been done?
numpy.diagonalinkeras/src/backend/openvino/numpy.pypytest.inito ensure tests run withKERAS_BACKEND=openvinoTesting
Tests were run locally with:
Some NumpyDtypeTest::test_diagonal failures are due to missing JAX locally; these are expected to pass in CI where JAX is installed.
Related issue
Fixes #29116
CC: @rkazants