Skip to content

Openvino numpy ravel #21231

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 5 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions keras/src/backend/openvino/excluded_concrete_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ NumpyDtypeTest::test_outer_
NumpyDtypeTest::test_power
NumpyDtypeTest::test_prod
NumpyDtypeTest::test_quantile
NumpyDtypeTest::test_ravel
NumpyDtypeTest::test_repeat
NumpyDtypeTest::test_roll
NumpyDtypeTest::test_round
Expand Down Expand Up @@ -102,7 +101,6 @@ NumpyOneInputOpsCorrectnessTest::test_pad_int8_constant_2
NumpyOneInputOpsCorrectnessTest::test_pad_uint8_constant_2
NumpyOneInputOpsCorrectnessTest::test_pad_int32_constant_2
NumpyOneInputOpsCorrectnessTest::test_prod
NumpyOneInputOpsCorrectnessTest::test_ravel
NumpyOneInputOpsCorrectnessTest::test_real
NumpyOneInputOpsCorrectnessTest::test_reciprocal
NumpyOneInputOpsCorrectnessTest::test_repeat
Expand Down
6 changes: 5 additions & 1 deletion keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,11 @@ def quantile(x, q, axis=None, method="linear", keepdims=False):


def ravel(x):
raise NotImplementedError("`ravel` is not supported with openvino backend")
x = get_ov_output(x)
target_shape = ov_opset.constant([-1], dtype=Type.i32).output(0)
return OpenVINOKerasTensor(
ov_opset.reshape(x, target_shape, special_zero=False).output(0)
)


def real(x):
Expand Down