File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
keras/src/backend/openvino Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1021,9 +1021,18 @@ def log2(x):
1021
1021
1022
1022
1023
1023
def logaddexp (x1 , x2 ):
1024
- raise NotImplementedError (
1025
- "`logaddexp` is not supported with openvino backend"
1026
- )
1024
+ x1 = get_ov_output (x1 )
1025
+ x2 = get_ov_output (x2 )
1026
+
1027
+ x1 , x2 = _align_operand_types (x1 , x2 , "logaddexp()" )
1028
+
1029
+ max_val = ov_opset .maximum (x1 , x2 ).output (0 )
1030
+ abs_diff = ov_opset .abs (ov_opset .subtract (x1 , x2 ).output (0 )).output (0 )
1031
+ neg_abs_diff = ov_opset .negative (abs_diff ).output (0 )
1032
+ exp_neg_abs = ov_opset .exp (neg_abs_diff ).output (0 )
1033
+ log1p_exp = ov_opset .log1p (exp_neg_abs ).output (0 )
1034
+ result = ov_opset .add (max_val , log1p_exp ).output (0 )
1035
+ return OpenVINOKerasTensor (result )
1027
1036
1028
1037
1029
1038
def logical_and (x1 , x2 ):
You can’t perform that action at this time.
0 commit comments