Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -22,7 +22,6 @@ NumpyDtypeTest::test_diag
NumpyDtypeTest::test_diff
NumpyDtypeTest::test_digitize
NumpyDtypeTest::test_einsum
NumpyDtypeTest::test_empty
NumpyDtypeTest::test_exp2
NumpyDtypeTest::test_expm1
NumpyDtypeTest::test_eye
Expand Down
11 changes: 10 additions & 1 deletion keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,16 @@ def dot(x, y):


def empty(shape, dtype=None):
raise NotImplementedError("`empty` is not supported with openvino backend")
if dtype is not None:
ov_type = OPENVINO_DTYPES[standardize_dtype(dtype)]
else:
ov_type = Type.f32
if isinstance(shape, tuple):
shape = list(shape)
elif isinstance(shape, int):
shape = [shape]
empty_tensor = ov_opset.parameter(shape, ov_type).output(0)
return OpenVINOKerasTensor(empty_tensor)
Copy link
Contributor

Choose a reason for hiding this comment

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

not correct implementation:)
Now you are adding parameter that is a new input to model.

Please check how it is implemented for other backends and try to interpret it.

Copy link
Contributor Author

@arkhamHack arkhamHack Mar 12, 2025

Choose a reason for hiding this comment

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

Hi, so I noticed in tensorflow backend they return a shape matrix of zeroes. Should i implement the same? The main issue here was returning a unintialized shape (with garbage values) or array like in numpy empty. Couldn't find any good opset for that in openvino. Also checked jax they are also returning zeroes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rkazants do let me know if this is okay, i'll push the changes in that case. Thanks :)



def equal(x1, x2):
Expand Down