Skip to content

Commit be9a941

Browse files
committed
Fix log function to properly handle type conversion for integral inputs
1 parent 4f36c50 commit be9a941

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

keras/src/backend/openvino/numpy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,10 @@ def linspace(
832832

833833
def log(x):
834834
x = get_ov_output(x)
835+
x_type = x.get_element_type()
836+
if x_type.is_integral():
837+
x_type = OPENVINO_DTYPES[config.floatx()]
838+
x = ov_opset.convert(x, x_type)
835839
return OpenVINOKerasTensor(ov_opset.log(x).output(0))
836840

837841

0 commit comments

Comments
 (0)