Skip to content

[OpenVINO Backend]: support numpy.ndim #21176

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

Merged
merged 2 commits into from
Apr 16, 2025
Merged

Conversation

11happy
Copy link
Contributor

@11happy 11happy commented Apr 16, 2025

@codecov-commenter
Copy link

codecov-commenter commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.58%. Comparing base (1ea81a1) to head (d8ef032).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21176   +/-   ##
=======================================
  Coverage   82.58%   82.58%           
=======================================
  Files         564      564           
  Lines       54359    54363    +4     
  Branches     8448     8448           
=======================================
+ Hits        44891    44895    +4     
  Misses       7393     7393           
  Partials     2075     2075           
Flag Coverage Δ
keras 82.39% <100.00%> (+<0.01%) ⬆️
keras-jax 63.80% <0.00%> (-0.01%) ⬇️
keras-numpy 58.92% <0.00%> (-0.01%) ⬇️
keras-openvino 32.92% <100.00%> (+0.01%) ⬆️
keras-tensorflow 64.21% <0.00%> (-0.01%) ⬇️
keras-torch 63.89% <0.00%> (-0.01%) ⬇️

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 1039 to 1041
x = get_ov_output(x)
x_shape = x.get_partial_shape()
x_dim = x_shape.rank.get_length()
Copy link
Contributor

Choose a reason for hiding this comment

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

let us better implement this using ShapeOf->ShapeOf subgraph

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, however I am curious about the two approaches, from a performance standpoint, would one approach be more efficient than the other?

Thank you

Copy link
Contributor

Choose a reason for hiding this comment

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

No performance advantage. In case dynamic rank, get_length will return exception and ShapeOf->Shape approach will work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I appreciate the explanation.

Copy link
Contributor

@rkazants rkazants left a comment

Choose a reason for hiding this comment

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

@fchollet, look good to me. Recommend to merge

@fchollet fchollet merged commit 8e4b4ab into keras-team:master Apr 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue][Keras 3 OpenVINO Backend]: Support numpy.ndim operation
5 participants