diff --git a/src/frontends/pytorch/src/frontend.cpp b/src/frontends/pytorch/src/frontend.cpp index af427798a2c1c4..b1e61fbcae9085 100644 --- a/src/frontends/pytorch/src/frontend.cpp +++ b/src/frontends/pytorch/src/frontend.cpp @@ -211,7 +211,7 @@ void FrontEnd::normalize(const std::shared_ptr& model) const { manager.register_pass(); // Second pass of AlignTypesRemoval after all converting transformations manager.register_pass(); - manager.register_pass(); + manager.register_pass(true); manager.run_passes(model); apply_pytorch_conversion_transforms(model); diff --git a/src/frontends/pytorch/src/node_context.cpp b/src/frontends/pytorch/src/node_context.cpp index db2d520c98cf95..364999ccbe13cb 100644 --- a/src/frontends/pytorch/src/node_context.cpp +++ b/src/frontends/pytorch/src/node_context.cpp @@ -50,7 +50,6 @@ OutputVector NodeContext::as_constant() const { std::shared_ptr NodeContext::mark_node(std::shared_ptr ov_node) const { ov_node = m_decoder->mark_node(ov_node); - m_translate_session->unique_name(ov_node); return ov_node; } diff --git a/src/frontends/pytorch/src/translate_session.cpp b/src/frontends/pytorch/src/translate_session.cpp index 16090fe0e42931..1beed272f43c48 100644 --- a/src/frontends/pytorch/src/translate_session.cpp +++ b/src/frontends/pytorch/src/translate_session.cpp @@ -402,14 +402,6 @@ Output TranslateSession::get_reverseprop_op(const std::shared_ptr(node, OutputVector{value}, 1, true); } -void TranslateSession::unique_name(const std::shared_ptr& node) { - if (m_unique_friendly_name_set.count(node->get_friendly_name())) { - node->set_friendly_name(node->get_friendly_name() + '_' + std::to_string(m_friendly_name_counter++)); - } else { - m_unique_friendly_name_set.insert(node->get_friendly_name()); - } -} - } // namespace pytorch } // namespace frontend } // namespace ov diff --git a/src/frontends/pytorch/src/translate_session.hpp b/src/frontends/pytorch/src/translate_session.hpp index de65d1c4ed9eae..80407c0776a006 100644 --- a/src/frontends/pytorch/src/translate_session.hpp +++ b/src/frontends/pytorch/src/translate_session.hpp @@ -47,9 +47,6 @@ class TranslateSession { /// \brief Gets pytorch tensor index from openvino tensor size_t decode_tensor_name(const Output& tensor_desc); - /// \brief Make sure Node has unique name - void unique_name(const std::shared_ptr& node); - // Maps tensor index to initial tensor index which it is alias to, and to decoder of the node produced this alias // and to the output produced during conversion of this node std::map, Output>> m_may_be_alias; @@ -64,8 +61,6 @@ class TranslateSession { std::map>> m_counter_map; std::map m_op_statistics; - std::unordered_set m_unique_friendly_name_set; - size_t m_friendly_name_counter = 0; }; } // namespace pytorch