Skip to content
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 @@ -33,7 +33,6 @@ NumpyDtypeTest::test_isfinite
NumpyDtypeTest::test_isinf
NumpyDtypeTest::test_isnan
NumpyDtypeTest::test_linspace
NumpyDtypeTest::test_log1p
NumpyDtypeTest::test_logaddexp
NumpyDtypeTest::test_logspace
Copy link
Contributor

Choose a reason for hiding this comment

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

please also remove NumpyOneInputOpsCorrectnessTest::test_log1p below

NumpyDtypeTest::test_matmul_
Expand Down Expand Up @@ -98,7 +97,6 @@ NumpyOneInputOpsCorrectnessTest::test_hstack
NumpyOneInputOpsCorrectnessTest::test_imag
NumpyOneInputOpsCorrectnessTest::test_isfinite
NumpyOneInputOpsCorrectnessTest::test_isinf
NumpyOneInputOpsCorrectnessTest::test_log1p
NumpyOneInputOpsCorrectnessTest::test_logaddexp
NumpyOneInputOpsCorrectnessTest::test_max
NumpyOneInputOpsCorrectnessTest::test_mean
Expand Down
12 changes: 11 additions & 1 deletion keras/src/backend/openvino/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,17 @@ def log10(x):


def log1p(x):
raise NotImplementedError("`log1p` is not supported with openvino backend")
x = get_ov_output(x)
x_type = x.get_element_type()

if x_type.is_integral():
x_type = OPENVINO_DTYPES[config.floatx()]
x = ov_opset.convert(x, x_type)

one_const = ov_opset.constant(1, x_type).output(0)
added = ov_opset.add(x, one_const).output(0)
result = ov_opset.log(added).output(0)
return OpenVINOKerasTensor(result)

Copy link
Contributor

Choose a reason for hiding this comment

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

please add more one blank line to pass CI jobs


def log2(x):
Expand Down