Skip to content

[OpenVINO backend] Update ndim behavior #21317

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 7 commits into from
Jul 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,9 @@ def nan_to_num(x, nan=0.0, posinf=None, neginf=None):

def ndim(x):
x = get_ov_output(x)
x_shape = ov_opset.shape_of(x).output(0)
x_dim = ov_opset.shape_of(x_shape, "i64")
return x_dim
shape_tensor = ov_opset.shape_of(x, Type.i64).output(0)
rank_tensor = ov_opset.shape_of(shape_tensor, Type.i64).output(0)
return OpenVINOKerasTensor(rank_tensor)


def nonzero(x):
Expand Down