diff --git a/src/frontends/tensorflow/src/op_table.cpp b/src/frontends/tensorflow/src/op_table.cpp index 7c093d7301a..f763cca9afc 100644 --- a/src/frontends/tensorflow/src/op_table.cpp +++ b/src/frontends/tensorflow/src/op_table.cpp @@ -286,6 +286,7 @@ const std::map get_supported_ops() { {"While", CreatorFunction(translate_while_op)}, {"Where", CreatorFunction(translate_where_op)}, {"Xdivy", CreatorFunction(translate_x_div_y_op)}, + {"Xlog1py", CreatorFunction(translate_xlog1py_op)}, {"Xlogy", CreatorFunction(translate_xlogy_op)}, {"ZerosLike", CreatorFunction(translate_zeros_like_op)}, diff --git a/src/frontends/tensorflow_common/include/common_op_table.hpp b/src/frontends/tensorflow_common/include/common_op_table.hpp index 9c1f995f25f..ff4e920f61d 100644 --- a/src/frontends/tensorflow_common/include/common_op_table.hpp +++ b/src/frontends/tensorflow_common/include/common_op_table.hpp @@ -149,6 +149,7 @@ OP_CONVERTER(translate_unravel_index_op); OP_CONVERTER(translate_unsorted_segment_sum_op); OP_CONVERTER(translate_where_op); OP_CONVERTER(translate_x_div_y_op); +OP_CONVERTER(translate_xlog1py_op); OP_CONVERTER(translate_xlogy_op); OP_CONVERTER(translate_zeros_like_op); diff --git a/src/frontends/tensorflow_common/src/op/xlog1py.cpp b/src/frontends/tensorflow_common/src/op/xlog1py.cpp new file mode 100644 index 00000000000..cf24fec5438 --- /dev/null +++ b/src/frontends/tensorflow_common/src/op/xlog1py.cpp @@ -0,0 +1,43 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_op_table.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/equal.hpp" +#include "openvino/op/log.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/select.hpp" + +using namespace std; +using namespace ov::opset10; + +namespace ov { +namespace frontend { +namespace tensorflow { +namespace op { +OutputVector translate_xlog1py_op(const NodeContext& node) { + default_op_checks(node, 2, {"Xlog1py"}); + auto x = node.get_input(0); + auto y = node.get_input(1); + + // prepare auxiliary constants of the same type as the input + auto zero = create_same_type_const_scalar(x, 0); + auto one = create_same_type_const_scalar(y, 1); + + // compute a mask to identify where x is equal to 0 + auto is_zero = make_shared(x, zero); + + // compute x * log(y + 1) elementwise + auto xlog1py = make_shared(x, make_shared(make_shared(y, one))); + + // create the output tensor using Select to handle the x == 0 condition + auto result = make_shared