Skip to content

Implement numpy.prod method for OpenVino backend #21282

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sanleo-wq
Copy link
Contributor

issue: #30212

Follows the same pattern as other similar functions in the file
Passes all tests
I've removed the test from the excluded tests list, which allows for proper validation of the functionality.

@rkazants for review
All tests are passing

@codecov-commenter
Copy link

codecov-commenter commented May 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Project coverage is 82.55%. Comparing base (dfaca0e) to head (ffe2667).

Files with missing lines Patch % Lines
keras/src/backend/openvino/numpy.py 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21282      +/-   ##
==========================================
- Coverage   82.57%   82.55%   -0.03%     
==========================================
  Files         564      564              
  Lines       54677    54695      +18     
  Branches     8500     8505       +5     
==========================================
  Hits        45152    45152              
- Misses       7435     7453      +18     
  Partials     2090     2090              
Flag Coverage Δ
keras 82.36% <0.00%> (-0.03%) ⬇️
keras-jax 63.59% <0.00%> (-0.03%) ⬇️
keras-numpy 58.72% <0.00%> (-0.02%) ⬇️
keras-openvino 33.03% <0.00%> (-0.02%) ⬇️
keras-tensorflow 64.00% <0.00%> (-0.03%) ⬇️
keras-torch 63.66% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +1254 to +1255
if dtype is None and original_type != result.get_element_type():
result = ov_opset.convert(result, original_type).output(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

according to the logic, if dtype is None, original_type is always equal to result's one. Please correct me.
That is because reshape and reduce_prod preserve tensor type:)

.ruff_cachekeras_venv/
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove changes here.
Switch on tests for prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants