-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Fix(OpenVINO): Ensure numpy.prod passes tests and handles boolean inp… #21403
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?
Fix(OpenVINO): Ensure numpy.prod passes tests and handles boolean inp… #21403
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21403 +/- ##
=======================================
Coverage 82.67% 82.67%
=======================================
Files 565 565
Lines 55073 55100 +27
Branches 8571 8578 +7
=======================================
+ Hits 45532 45556 +24
- Misses 7443 7445 +2
- Partials 2098 2099 +1
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:
|
.gitignore
Outdated
.ruff_cache No newline at end of file | ||
.ruff_cache | ||
my_clean_keras_env_py310/ |
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.
please revert these changes
keras/src/backend/openvino/numpy.py
Outdated
promotion_map = { | ||
Type.bf16: Type.bf16, | ||
Type.f16: Type.f16, | ||
Type.f32: Type.f32, | ||
Type.f64: Type.f64, | ||
Type.i8: Type.i32, | ||
Type.i16: Type.i32, | ||
Type.i32: Type.i32, | ||
Type.i64: Type.i64, | ||
Type.u8: Type.u32, | ||
Type.u16: Type.u32, | ||
Type.u32: Type.u32, | ||
Type.u64: Type.u64, | ||
} |
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.
please use the same dictionary from core.py
keras/src/backend/openvino/numpy.py
Outdated
|
||
temporary_result = ov_opset.reduce_prod(x, axis, keepdims).output(0) |
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.
name this var prod_result
…Mezalfa/keras into feature/openvino-numpy-prod-fix
This pull request implements keras.numpy.prod for the OpenVINO backend.
Features:
Handles reduction along specified axes, including single integers, tuples, and None.
Implements promotion for dtype when dtype is passed as None ,converting to a suitable OpenVINO type.
If dtype is specified, the output is converted to the specified dtype.
Properly manages the keepdims argument to retain or drop the reduced dimensions in the output shape.