Skip to content

Commit

Permalink
Update src/frontends/tensorflow_common/src/op/truncate_div.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
rkazants authored Oct 19, 2023
1 parent 8a469f1 commit 8677cae
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/frontends/tensorflow_common/src/op/truncate_div.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ OutputVector translate_truncate_div_op(const NodeContext& node) {
auto y = node.get_input(1);

auto res = make_shared<Divide>(x, y);
auto mod_res = make_shared<Mod>(x, y);
auto is_mod_zero = make_shared<Equal>(mod_res, create_same_type_const_scalar(x, 0));
auto is_res_negative = make_shared<Less>(res, create_same_type_const_scalar(x, 0));
auto final_res = make_shared<Select>(is_res_negative, make_shared<Ceiling>(res), make_shared<Floor>(res));

auto modified_res = make_shared<Select>(is_res_negative, make_shared<Ceiling>(res), make_shared<Floor>(res));

auto final = make_shared<Select>(is_mod_zero, res, modified_res);

set_node_name(node.get_name(), final);
return final->outputs();
set_node_name(node.get_name(), final_res);
return final_res->outputs();
}
} // namespace op
} // namespace tensorflow
Expand Down

0 comments on commit 8677cae

Please sign in to comment.