diff --git a/src/common/transformations/src/transformations/convert_precision.cpp b/src/common/transformations/src/transformations/convert_precision.cpp index 54fb6a972b7387..6f5166dfd26760 100644 --- a/src/common/transformations/src/transformations/convert_precision.cpp +++ b/src/common/transformations/src/transformations/convert_precision.cpp @@ -29,7 +29,7 @@ bool fuse_type_to_parameter(const std::shared_ptr& node, bool convert_input_precision); // this function inserts Convert operations to 'data' input and outputs of `node` -// to execute 'node' with the original type. +// to execute 'node' with the original type. This function supports nodes with single output. bool wrap_into_original_type(const std::shared_ptr& node, const precisions_map& precisions); bool store_original_type_as_attribute(const std::shared_ptr& node, const precisions_map& precisions); @@ -622,17 +622,20 @@ bool wrap_into_original_type(const std::shared_ptr& node, const precis const auto& to = it->second; const auto& from = it->first; - - auto convert_before = std::make_shared(node->input_value(0), from); - node->input(0).replace_source_output(convert_before); - auto consumers = node->output(0).get_target_inputs(); - auto convert_after = std::make_shared(node, to); - for (auto& input : consumers) { - const auto consumer = input.get_node(); - if (ov::is_type(consumer) || ov::is_type(consumer)) { - continue; + if (node->get_input_size()) { + auto convert_before = std::make_shared(node->input_value(0), from); + node->input(0).replace_source_output(convert_before); + } + if (node->get_output_size() == 1) { + auto consumers = node->output(0).get_target_inputs(); + auto convert_after = std::make_shared(node, to); + for (auto& input : consumers) { + const auto consumer = input.get_node(); + if (ov::is_type(consumer) || ov::is_type(consumer)) { + continue; + } + input.replace_source_output(convert_after); } - input.replace_source_output(convert_after); } return true;