Implement nanpercentile function in keras.ops#22679
Implement nanpercentile function in keras.ops#22679hertschuh merged 13 commits intokeras-team:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the nanpercentile operation across Keras backends, including JAX, NumPy, TensorFlow, and Torch, while marking it as unimplemented for OpenVINO. The implementation includes the core Nanpercentile operation, API exports, and extensive unit tests. Feedback focuses on improving the robustness of compute_output_spec regarding multi-dimensional percentile inputs and integer dtype promotion, as well as ensuring consistent tensor conversion and floating-point casting of the q parameter across the NumPy and Torch backends.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #22679 +/- ##
=======================================
Coverage 82.99% 83.00%
=======================================
Files 596 596
Lines 69629 69678 +49
Branches 10863 10869 +6
=======================================
+ Hits 57792 57836 +44
- Misses 8991 8995 +4
- Partials 2846 2847 +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:
|
hertschuh
left a comment
There was a problem hiding this comment.
Thanks!
But I'm realizing now that we don't even have ops.numpy.percentile right now.
|
I’ll take a look and add a implementation for ops.numpy.percentile. |
Description
Adds keras.ops.nanpercentile, which computes the q-th percentile of the input tensor along a specified axis while ignoring NaN values.
Supported across NumPy, TensorFlow, PyTorch, and JAX backends. Not supported on OpenVINO.
Contributor Agreement
Please check all boxes below before submitting your PR for review: