From 71fdcdf899a8669a9d8e8953c59c6e73532bbd2d Mon Sep 17 00:00:00 2001 From: Maxim Vafin Date: Sat, 19 Feb 2022 02:52:48 +0300 Subject: [PATCH] Fix Unpack translator in TF FE (#10494) * Fix Unpack translator in TF FE * Apply review feedback --- src/frontends/tensorflow/src/op/unpack.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/frontends/tensorflow/src/op/unpack.cpp b/src/frontends/tensorflow/src/op/unpack.cpp index 9e1de80962b..d5661148751 100644 --- a/src/frontends/tensorflow/src/op/unpack.cpp +++ b/src/frontends/tensorflow/src/op/unpack.cpp @@ -19,9 +19,17 @@ OutputVector translate_unpack_op(const NodeContext& node) { auto num = node.get_attribute("num"); auto axis_const = make_shared(element::i64, Shape{}, axis); - auto res = make_shared(input, axis_const, num); - set_node_name(node.get_name(), res); - return res->outputs(); + auto split = make_shared(input, axis_const, num); + OutputVector res; + int idx = 0; + for (auto out : split->outputs()) { + auto squeezed_res = make_shared(out, axis_const); + squeezed_res->set_friendly_name(node.get_name() + "/squeeze_" + to_string(idx)); + set_out_name(node.get_name() + ":" + std::to_string(idx), squeezed_res->output(0)); + ++idx; + res.push_back(squeezed_res); + } + return res; } } // namespace op } // namespace tensorflow