Skip to content

Updated numpy.flip using openvino opset #21057

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion keras/src/backend/openvino/excluded_concrete_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ NumpyOneInputOpsCorrectnessTest::test_diag
NumpyOneInputOpsCorrectnessTest::test_diagonal
NumpyOneInputOpsCorrectnessTest::test_exp2
NumpyOneInputOpsCorrectnessTest::test_expm1
NumpyOneInputOpsCorrectnessTest::test_flip
NumpyOneInputOpsCorrectnessTest::test_floor_divide
NumpyOneInputOpsCorrectnessTest::test_hstack
NumpyOneInputOpsCorrectnessTest::test_imag
Expand Down
12 changes: 10 additions & 2 deletions keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,16 @@ def expm1(x):


def flip(x, axis=None):
raise NotImplementedError("`flip` is not supported with openvino backend")
rank=len(x.shape)

if axis is None:
axis=list(range(rank))


axis_tensor=np.array(axis,dtype=np.int32)
reversed_tensor=ov_opset.Reverse(x,axis_tensor)

return reversed_tensor


def floor(x):
Expand Down Expand Up @@ -842,7 +851,6 @@ def log10(x):
def log1p(x):
raise NotImplementedError("`log1p` is not supported with openvino backend")


def log2(x):
raise NotImplementedError("`log2` is not supported with openvino backend")

Expand Down
Loading