diff --git a/src/core/src/axis_vector.cpp b/src/core/src/axis_vector.cpp index 6f576f79abb..4c74dca49c2 100644 --- a/src/core/src/axis_vector.cpp +++ b/src/core/src/axis_vector.cpp @@ -2,15 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/axis_vector.hpp" +#include "openvino/core/axis_vector.hpp" -#include "ngraph/util.hpp" +#include "openvino/util/common_util.hpp" std::ostream& ov::operator<<(std::ostream& s, const AxisVector& axis_vector) { s << "AxisVector{"; - OPENVINO_SUPPRESS_DEPRECATED_START - s << ngraph::join(axis_vector); - OPENVINO_SUPPRESS_DEPRECATED_END + s << ov::util::join(axis_vector); s << "}"; return s; } diff --git a/src/core/src/op/util/activation_functions.cpp b/src/core/src/op/util/activation_functions.cpp index 55eca99e775..9663bce298a 100644 --- a/src/core/src/op/util/activation_functions.cpp +++ b/src/core/src/op/util/activation_functions.cpp @@ -2,38 +2,36 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/activation_functions.hpp" +#include "openvino/op/util/activation_functions.hpp" #include #include #include #include -#include "ngraph/op/constant.hpp" -#include "ngraph/op/hard_sigmoid.hpp" -#include "ngraph/op/relu.hpp" -#include "ngraph/op/sigmoid.hpp" -#include "ngraph/op/tanh.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/hard_sigmoid.hpp" +#include "openvino/op/relu.hpp" +#include "openvino/op/sigmoid.hpp" +#include "openvino/op/tanh.hpp" -using namespace std; - -static shared_ptr sigmoid(const shared_ptr& arg, float /* alpha */, float /* beta */) { - return make_shared(arg); +static std::shared_ptr sigmoid(const std::shared_ptr& arg, float /* alpha */, float /* beta */) { + return std::make_shared(arg); } -static shared_ptr tanh(const shared_ptr& arg, float /* alpha */, float /* beta */) { - return make_shared(arg); +static std::shared_ptr tanh(const std::shared_ptr& arg, float /* alpha */, float /* beta */) { + return std::make_shared(arg); } -static shared_ptr relu(const shared_ptr& arg, float /* alpha */, float /* beta */) { - return make_shared(arg); +static std::shared_ptr relu(const std::shared_ptr& arg, float /* alpha */, float /* beta */) { + return std::make_shared(arg); } -static shared_ptr hardsigmoid(const shared_ptr& arg, float alpha, float beta) { - const auto alpha_node = ngraph::op::Constant::create(arg->get_element_type(), ngraph::Shape{}, {alpha}); - const auto beta_node = ngraph::op::Constant::create(arg->get_element_type(), ngraph::Shape{}, {beta}); +static std::shared_ptr hardsigmoid(const std::shared_ptr& arg, float alpha, float beta) { + const auto alpha_node = ov::op::v0::Constant::create(arg->get_element_type(), ov::Shape{}, {alpha}); + const auto beta_node = ov::op::v0::Constant::create(arg->get_element_type(), ov::Shape{}, {beta}); - return make_shared(arg, alpha_node, beta_node); + return std::make_shared(arg, alpha_node, beta_node); } ov::op::util::ActivationFunction::ActivationFunction(ActivationFunctionType f, float alpha, float beta) @@ -47,12 +45,12 @@ ov::op::util::ActivationFunction::ActivationFunction(ActivationFunctionType f, f ov::op::util::ActivationFunction::ActivationFunction(ActivationFunctionType f) : ActivationFunction(f, nanf(""), nanf("")) {} -shared_ptr ov::op::util::ActivationFunction::operator()(const shared_ptr& arg) const { +std::shared_ptr ov::op::util::ActivationFunction::operator()(const std::shared_ptr& arg) const { return m_function(arg, m_alpha, m_beta); } -ov::op::util::ActivationFunction ov::op::util::get_activation_func_by_name(const string& func_name) { - using ActivationFunctionMap = unordered_map; +ov::op::util::ActivationFunction ov::op::util::get_activation_func_by_name(const std::string& func_name) { + using ActivationFunctionMap = std::unordered_map; static ActivationFunctionMap func_map{ {"sigmoid", op::util::ActivationFunction{sigmoid}}, diff --git a/src/core/src/op/util/arithmetic_reduction.cpp b/src/core/src/op/util/arithmetic_reduction.cpp index b59ea93aeb3..43db89f6260 100644 --- a/src/core/src/op/util/arithmetic_reduction.cpp +++ b/src/core/src/op/util/arithmetic_reduction.cpp @@ -2,12 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/arithmetic_reduction.hpp" +#include "openvino/op/util/arithmetic_reduction.hpp" #include "itt.hpp" -#include "ngraph/validation_util.hpp" - -using namespace std; ov::op::util::ArithmeticReduction::ArithmeticReduction() = default; diff --git a/src/core/src/op/util/arithmetic_reductions_keep_dims.cpp b/src/core/src/op/util/arithmetic_reductions_keep_dims.cpp index 398e7d890da..fe80b4cef52 100644 --- a/src/core/src/op/util/arithmetic_reductions_keep_dims.cpp +++ b/src/core/src/op/util/arithmetic_reductions_keep_dims.cpp @@ -2,19 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" +#include "openvino/op/util/arithmetic_reductions_keep_dims.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/validation_util.hpp" -using namespace std; - -ov::op::util::ArithmeticReductionKeepDims::ArithmeticReductionKeepDims( - const ngraph::Output& arg, - const ngraph::Output& reduction_axes, - bool keep_dims) +ov::op::util::ArithmeticReductionKeepDims::ArithmeticReductionKeepDims(const ov::Output& arg, + const ov::Output& reduction_axes, + bool keep_dims) : ArithmeticReduction(arg, reduction_axes), m_keep_dims{keep_dims} {} diff --git a/src/core/src/op/util/attr_types.cpp b/src/core/src/op/util/attr_types.cpp index 3a4f1f33ec1..02fdaffef6b 100644 --- a/src/core/src/op/util/attr_types.cpp +++ b/src/core/src/op/util/attr_types.cpp @@ -2,109 +2,105 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/util/attr_types.hpp" #include #include -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/check.hpp" -#include "ngraph/enum_names.hpp" +#include "openvino/core/except.hpp" namespace ov { template <> -NGRAPH_API EnumNames& EnumNames::get() { - static auto enum_names = EnumNames("ngraph::op::PadMode", - {{"constant", ngraph::op::PadMode::CONSTANT}, - {"edge", ngraph::op::PadMode::EDGE}, - {"reflect", ngraph::op::PadMode::REFLECT}, - {"symmetric", ngraph::op::PadMode::SYMMETRIC}}); +OPENVINO_API EnumNames& EnumNames::get() { + static auto enum_names = EnumNames("ov::op::PadMode", + {{"constant", ov::op::PadMode::CONSTANT}, + {"edge", ov::op::PadMode::EDGE}, + {"reflect", ov::op::PadMode::REFLECT}, + {"symmetric", ov::op::PadMode::SYMMETRIC}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { - static auto enum_names = EnumNames("ngraph::op::PadType", - {{"explicit", ngraph::op::PadType::EXPLICIT}, - {"same_lower", ngraph::op::PadType::SAME_LOWER}, - {"same_upper", ngraph::op::PadType::SAME_UPPER}, - {"valid", ngraph::op::PadType::VALID}}); +OPENVINO_API EnumNames& EnumNames::get() { + static auto enum_names = EnumNames("ov::op::PadType", + {{"explicit", ov::op::PadType::EXPLICIT}, + {"same_lower", ov::op::PadType::SAME_LOWER}, + {"same_upper", ov::op::PadType::SAME_UPPER}, + {"valid", ov::op::PadType::VALID}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { - static auto enum_names = EnumNames( - "ngraph::op::RoundingType", - {{"floor", ngraph::op::RoundingType::FLOOR}, {"ceil", ngraph::op::RoundingType::CEIL}}); - return enum_names; -} - -template <> -NGRAPH_API EnumNames& EnumNames::get() { +OPENVINO_API EnumNames& EnumNames::get() { static auto enum_names = - EnumNames("ngraph::op::AutoBroadcastType", - {{"none", ngraph::op::AutoBroadcastType::NONE}, - {"explicit", ngraph::op::AutoBroadcastType::EXPLICIT}, - {"numpy", ngraph::op::AutoBroadcastType::NUMPY}, - {"pdpd", ngraph::op::AutoBroadcastType::PDPD}}); + EnumNames("ov::op::RoundingType", + {{"floor", ov::op::RoundingType::FLOOR}, {"ceil", ov::op::RoundingType::CEIL}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { +OPENVINO_API EnumNames& EnumNames::get() { + static auto enum_names = EnumNames("ov::op::AutoBroadcastType", + {{"none", ov::op::AutoBroadcastType::NONE}, + {"explicit", ov::op::AutoBroadcastType::EXPLICIT}, + {"numpy", ov::op::AutoBroadcastType::NUMPY}, + {"pdpd", ov::op::AutoBroadcastType::PDPD}}); + return enum_names; +} + +template <> +OPENVINO_API EnumNames& EnumNames::get() { static auto enum_names = - EnumNames("ngraph::op::BroadcastType", - {{"explicit", ngraph::op::BroadcastType::EXPLICIT}, - {"none", ngraph::op::BroadcastType::NONE}, - {"numpy", ngraph::op::BroadcastType::NUMPY}, - {"pdpd", ngraph::op::BroadcastType::PDPD}, - {"bidirectional", ngraph::op::BroadcastType::BIDIRECTIONAL}}); + EnumNames("ov::op::BroadcastType", + {{"explicit", ov::op::BroadcastType::EXPLICIT}, + {"none", ov::op::BroadcastType::NONE}, + {"numpy", ov::op::BroadcastType::NUMPY}, + {"pdpd", ov::op::BroadcastType::PDPD}, + {"bidirectional", ov::op::BroadcastType::BIDIRECTIONAL}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { +OPENVINO_API EnumNames& EnumNames::get() { static auto enum_names = - EnumNames("ngraph::op::EpsMode", - {{"add", ngraph::op::EpsMode::ADD}, {"max", ngraph::op::EpsMode::MAX}}); + EnumNames("ov::op::EpsMode", {{"add", ov::op::EpsMode::ADD}, {"max", ov::op::EpsMode::MAX}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { - static auto enum_names = EnumNames("ngraph::op::TopKSortType", - {{"none", ngraph::op::TopKSortType::NONE}, - {"index", ngraph::op::TopKSortType::SORT_INDICES}, - {"value", ngraph::op::TopKSortType::SORT_VALUES}}); +OPENVINO_API EnumNames& EnumNames::get() { + static auto enum_names = EnumNames("ov::op::TopKSortType", + {{"none", ov::op::TopKSortType::NONE}, + {"index", ov::op::TopKSortType::SORT_INDICES}, + {"value", ov::op::TopKSortType::SORT_VALUES}}); return enum_names; } template <> -NGRAPH_API EnumNames& EnumNames::get() { +OPENVINO_API EnumNames& EnumNames::get() { static auto enum_names = - EnumNames("ngraph::op::TopKMode", - {{"min", ngraph::op::TopKMode::MIN}, {"max", ngraph::op::TopKMode::MAX}}); + EnumNames("ov::op::TopKMode", + {{"min", ov::op::TopKMode::MIN}, {"max", ov::op::TopKMode::MAX}}); return enum_names; } -bool AttributeAdapter::visit_attributes(AttributeVisitor& visitor) { +bool AttributeAdapter::visit_attributes(AttributeVisitor& visitor) { // Maintain back-compatibility std::string name = visitor.finish_structure(); visitor.on_attribute(name, m_ref.m_type); visitor.start_structure(name); - if (m_ref.m_type == ngraph::op::AutoBroadcastType::PDPD) { + if (m_ref.m_type == ov::op::AutoBroadcastType::PDPD) { visitor.on_attribute("auto_broadcast_axis", m_ref.m_axis); } return true; } -bool AttributeAdapter::visit_attributes(AttributeVisitor& visitor) { +bool AttributeAdapter::visit_attributes(AttributeVisitor& visitor) { // Maintain back-compatibility std::string name = visitor.finish_structure(); visitor.on_attribute(name, m_ref.m_type); visitor.start_structure(name); - if (m_ref.m_type == ngraph::op::BroadcastType::PDPD) { + if (m_ref.m_type == ov::op::BroadcastType::PDPD) { visitor.start_structure(name); visitor.on_attribute("axis", m_ref.m_axis); visitor.finish_structure(); @@ -113,44 +109,44 @@ bool AttributeAdapter::visit_attributes(Attribute } template <> -NGRAPH_API EnumNames& EnumNames::get() { - static auto enum_names = EnumNames( - "ngraph::op::RecurrentSequenceDirection", - {{"forward", ngraph::op::RecurrentSequenceDirection::FORWARD}, - {"reverse", ngraph::op::RecurrentSequenceDirection::REVERSE}, - {"bidirectional", ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL}}); +OPENVINO_API EnumNames& EnumNames::get() { + static auto enum_names = EnumNames( + "ov::op::RecurrentSequenceDirection", + {{"forward", ov::op::RecurrentSequenceDirection::FORWARD}, + {"reverse", ov::op::RecurrentSequenceDirection::REVERSE}, + {"bidirectional", ov::op::RecurrentSequenceDirection::BIDIRECTIONAL}}); return enum_names; } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::PadMode& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::PadMode& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::PadType& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::PadType& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::RoundingType& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::RoundingType& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::BroadcastType& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::BroadcastType& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::AutoBroadcastType& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::AutoBroadcastType& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::EpsMode& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::EpsMode& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::TopKSortType& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::TopKSortType& type) { return s << as_string(type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::TopKMode& type) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::TopKMode& type) { return s << as_string(type); } @@ -165,12 +161,12 @@ op::AutoBroadcastType op::AutoBroadcastSpec::type_from_string(const std::string& {"pdpd", AutoBroadcastType::PDPD}, {"explicit", AutoBroadcastType::EXPLICIT}}; - NGRAPH_CHECK(allowed_values.count(lowercase_type) > 0, "Invalid 'type' value passed in."); + OPENVINO_ASSERT(allowed_values.count(lowercase_type) > 0, "Invalid 'type' value passed in."); return allowed_values.at(lowercase_type); } -std::ostream& op::operator<<(std::ostream& s, const ngraph::op::RecurrentSequenceDirection& direction) { +std::ostream& op::operator<<(std::ostream& s, const ov::op::RecurrentSequenceDirection& direction) { return s << as_string(direction); } } // namespace ov diff --git a/src/core/src/op/util/binary_elementwise_arithmetic.cpp b/src/core/src/op/util/binary_elementwise_arithmetic.cpp index c7331bf84d4..c605065e041 100644 --- a/src/core/src/op/util/binary_elementwise_arithmetic.cpp +++ b/src/core/src/op/util/binary_elementwise_arithmetic.cpp @@ -2,14 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/binary_elementwise_arithmetic.hpp" +#include "openvino/op/util/binary_elementwise_arithmetic.hpp" #include "bound_evaluate.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/util/elementwise_args.hpp" - -using namespace std; +#include "openvino/op/util/elementwise_args.hpp" ov::op::util::BinaryElementwiseArithmetic::BinaryElementwiseArithmetic(const AutoBroadcastSpec& autob) : m_autob(autob) {} diff --git a/src/core/src/op/util/binary_elementwise_comparison.cpp b/src/core/src/op/util/binary_elementwise_comparison.cpp index 284139f1d3d..c4464505879 100644 --- a/src/core/src/op/util/binary_elementwise_comparison.cpp +++ b/src/core/src/op/util/binary_elementwise_comparison.cpp @@ -2,13 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/binary_elementwise_comparison.hpp" +#include "openvino/op/util/binary_elementwise_comparison.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/util/elementwise_args.hpp" - -using namespace std; +#include "openvino/op/util/elementwise_args.hpp" ov::op::util::BinaryElementwiseComparison::BinaryElementwiseComparison(const AutoBroadcastSpec& autob) : m_autob(autob) {} diff --git a/src/core/src/op/util/binary_elementwise_logical.cpp b/src/core/src/op/util/binary_elementwise_logical.cpp index e0e16f52f72..9c4ec8a4923 100644 --- a/src/core/src/op/util/binary_elementwise_logical.cpp +++ b/src/core/src/op/util/binary_elementwise_logical.cpp @@ -2,13 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/binary_elementwise_logical.hpp" +#include "openvino/op/util/binary_elementwise_logical.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/util/elementwise_args.hpp" - -using namespace std; +#include "openvino/op/util/elementwise_args.hpp" ov::op::util::BinaryElementwiseLogical::BinaryElementwiseLogical() = default; diff --git a/src/core/src/op/util/broadcast_base.cpp b/src/core/src/op/util/broadcast_base.cpp index df5a89afe5f..527d854dc5d 100644 --- a/src/core/src/op/util/broadcast_base.cpp +++ b/src/core/src/op/util/broadcast_base.cpp @@ -2,19 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/broadcast_base.hpp" +#include "openvino/op/util/broadcast_base.hpp" -#include #include #include "bound_evaluate.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/concat.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/util/op_types.hpp" -#include "ngraph/partial_shape.hpp" +#include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/broadcast.hpp" +#include "ngraph/validation_util.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/concat.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" using namespace std; @@ -197,10 +195,10 @@ void ov::op::util::BroadcastBase::validate_and_infer_types() { PartialShape output_shape; OPENVINO_SUPPRESS_DEPRECATED_START - bool output_shape_defined = ngraph::evaluate_as_partial_shape(get_input_source_output(1), output_shape); + bool output_shape_defined = ov::evaluate_as_partial_shape(get_input_source_output(1), output_shape); OPENVINO_SUPPRESS_DEPRECATED_END - if (auto concat = ov::as_type_ptr(input_value(1).get_node_shared_ptr())) { + if (auto concat = ov::as_type_ptr(input_value(1).get_node_shared_ptr())) { auto concat_inputs = concat->inputs(); if (!output_shape_defined && concat->get_output_partial_shape(0).is_static() && @@ -208,7 +206,7 @@ void ov::op::util::BroadcastBase::validate_and_infer_types() { auto output_partial_shape = vector{}; for (const auto& concat_input : concat_inputs) { auto source_node_ptr = concat_input.get_source_output().get_node_shared_ptr(); - if (auto source_const_ptr = ov::as_type_ptr(source_node_ptr)) { + if (auto source_const_ptr = ov::as_type_ptr(source_node_ptr)) { output_partial_shape.emplace_back(source_const_ptr->get_axis_vector_val()[0]); } else { output_partial_shape.push_back(Dimension::dynamic()); @@ -267,7 +265,7 @@ std::pair ov::op::util::BroadcastBase::get_broadcast_axes_num int64_t start_axis = ((broadcast_spec.m_type == op::BroadcastType::PDPD) && (broadcast_spec.m_axis != -1)) ? broadcast_spec.m_axis : static_cast(result_shape.size()) - static_cast(arg_shape.size()); - NGRAPH_CHECK(start_axis >= 0); + OPENVINO_ASSERT(start_axis >= 0); for (size_t i = 0; i < result_shape.size(); i++) { if (i < static_cast(start_axis) || result_shape[i] != arg_shape[i - start_axis]) { broadcast_axes.insert(i); @@ -304,7 +302,7 @@ std::pair ov::op::util::BroadcastBase::get_broadcast_axes() c if (get_input_partial_shape(1).is_static() && axes_mapping_constant) { auto axes_mapping_val = axes_mapping_constant->get_axis_vector_val(); auto target_shape = get_input_shape(1); - NGRAPH_CHECK(target_shape.size() == 1); + OPENVINO_ASSERT(target_shape.size() == 1); return get_broadcast_axes_none(axes_mapping_val, target_shape[0]); } } else if (m_mode.m_type == BroadcastType::NUMPY || m_mode.m_type == BroadcastType::PDPD) { @@ -377,11 +375,11 @@ void get_axis_vector_from_ht(const ngraph::HostTensorPtr& arg, OPENVINO_THROW("get_axis_vector_from_ht: type is not integral"); } // Rank(arg_shape) == shape_size(axes_mapping) - NGRAPH_CHECK(axis_vector.size() == arg_shape.size(), - "Broadcast axes_mapping shape ", - axis_vector.size(), - " doesn't match rank of input tensor ", - arg_shape.size()); + OPENVINO_ASSERT(axis_vector.size() == arg_shape.size(), + "Broadcast axes_mapping shape ", + axis_vector.size(), + " doesn't match rank of input tensor ", + arg_shape.size()); } template @@ -446,8 +444,8 @@ ov::Shape ov::op::util::BroadcastBase::get_target_shape(const HostTensorPtr& inp bool ov::op::util::BroadcastBase::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const { OV_OP_SCOPE(util_BroadcastBase_evaluate); OPENVINO_SUPPRESS_DEPRECATED_START - NGRAPH_CHECK(ngraph::validate_host_tensor_vector(inputs, 2) || ngraph::validate_host_tensor_vector(inputs, 3)); - NGRAPH_CHECK(ngraph::validate_host_tensor_vector(outputs, 1)); + OPENVINO_ASSERT(ngraph::validate_host_tensor_vector(inputs, 2) || ngraph::validate_host_tensor_vector(inputs, 3)); + OPENVINO_ASSERT(ngraph::validate_host_tensor_vector(outputs, 1)); OPENVINO_SUPPRESS_DEPRECATED_END Shape target_shape = get_target_shape(inputs[1]); diff --git a/src/core/src/op/util/deformable_convolution_base.cpp b/src/core/src/op/util/deformable_convolution_base.cpp index 32be72c2efb..cf2d053a297 100644 --- a/src/core/src/op/util/deformable_convolution_base.cpp +++ b/src/core/src/op/util/deformable_convolution_base.cpp @@ -6,8 +6,6 @@ #include "itt.hpp" -using namespace std; - ov::op::util::DeformableConvolutionBase::DeformableConvolutionBase(const OutputVector& arguments, const Strides& strides, const CoordinateDiff& pads_begin, diff --git a/src/core/src/op/util/detection_output_base.cpp b/src/core/src/op/util/detection_output_base.cpp index f8f1e3a22c9..450125089ab 100644 --- a/src/core/src/op/util/detection_output_base.cpp +++ b/src/core/src/op/util/detection_output_base.cpp @@ -2,23 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/detection_output_base.hpp" +#include "openvino/op/util/detection_output_base.hpp" -#include -#include +#include "detection_output_shape_inference.hpp" -#include "ngraph/op/concat.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/squeeze.hpp" -#include "ngraph/runtime/host_tensor.hpp" -#include "ngraph/shape.hpp" +ov::op::util::DetectionOutputBase::DetectionOutputBase(const ov::OutputVector& args) : Op(args) {} -using namespace std; -using namespace ov::op::util; - -DetectionOutputBase::DetectionOutputBase(const ov::OutputVector& args) : Op(args) {} - -void DetectionOutputBase::validate_base(const DetectionOutputBase::AttributesBase& attrs) { +void ov::op::util::DetectionOutputBase::validate_base(const DetectionOutputBase::AttributesBase& attrs) { NODE_VALIDATION_CHECK( this, attrs.code_type == "caffe.PriorBoxParameter.CORNER" || attrs.code_type == "caffe.PriorBoxParameter.CENTER_SIZE", @@ -74,7 +64,7 @@ bool ov::op::util::DetectionOutputBase::visit_attributes_base(AttributeVisitor& return true; } -ov::Dimension DetectionOutputBase::compute_num_classes(const AttributesBase& attrs) { +ov::Dimension ov::op::util::DetectionOutputBase::compute_num_classes(const AttributesBase& attrs) { NODE_VALIDATION_CHECK(this, 3 == get_input_size() || get_input_size() == 5, "A number of arguments must be equal to 3 or equal to 5. Got ", diff --git a/src/core/src/op/util/elementwise_args.cpp b/src/core/src/op/util/elementwise_args.cpp index 5252f511c35..0557b2a22f4 100644 --- a/src/core/src/op/util/elementwise_args.cpp +++ b/src/core/src/op/util/elementwise_args.cpp @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/elementwise_args.hpp" +#include "openvino/op/util/elementwise_args.hpp" #include "eltwise_shape_inference.hpp" -#include "ngraph/op/util/binary_elementwise_arithmetic.hpp" std::tuple ov::op::util::validate_and_infer_elementwise_args(Node* node) { OPENVINO_ASSERT(node != nullptr, "Node is empty! Cannot validate eltwise arguments."); diff --git a/src/core/src/op/util/embeddingbag_offsets_base.cpp b/src/core/src/op/util/embeddingbag_offsets_base.cpp index 6a58f2cb5b2..cffe63000c2 100644 --- a/src/core/src/op/util/embeddingbag_offsets_base.cpp +++ b/src/core/src/op/util/embeddingbag_offsets_base.cpp @@ -2,13 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/embeddingbag_offsets_base.hpp" +#include "openvino/op/util/embeddingbag_offsets_base.hpp" #include "embeddingbag_offsets_shape_inference.hpp" #include "itt.hpp" -#include "ngraph/op/constant.hpp" - -using namespace std; ov::op::util::EmbeddingBagOffsetsBase::EmbeddingBagOffsetsBase(const Output& emb_table, const Output& indices, diff --git a/src/core/src/op/util/embeddingbag_packed_base.cpp b/src/core/src/op/util/embeddingbag_packed_base.cpp index 7fce2be82e4..8ebd84e2116 100644 --- a/src/core/src/op/util/embeddingbag_packed_base.cpp +++ b/src/core/src/op/util/embeddingbag_packed_base.cpp @@ -2,11 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/embeddingbag_packed_base.hpp" +#include "openvino/op/util/embeddingbag_packed_base.hpp" #include "embeddingbag_packed_shape_inference.hpp" #include "itt.hpp" -#include "ngraph/op/constant.hpp" #include "openvino/core/validation_util.hpp" using namespace std; diff --git a/src/core/src/op/util/fft_base.cpp b/src/core/src/op/util/fft_base.cpp index b97c354e79c..13c839994f8 100644 --- a/src/core/src/op/util/fft_base.cpp +++ b/src/core/src/op/util/fft_base.cpp @@ -2,15 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/fft_base.hpp" - -#include -#include +#include "openvino/op/util/fft_base.hpp" +#include "fft_base_shape_inference.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" - -using namespace std; ov::op::util::FFTBase::FFTBase(const Output& data, const Output& axes) : Op({data, axes}) {} diff --git a/src/core/src/op/util/framework_node.cpp b/src/core/src/op/util/framework_node.cpp index 82ad1af5fe0..8bc241ce71a 100644 --- a/src/core/src/op/util/framework_node.cpp +++ b/src/core/src/op/util/framework_node.cpp @@ -5,7 +5,6 @@ #include "openvino/op/util/framework_node.hpp" #include "itt.hpp" -#include "ngraph/graph_util.hpp" ov::op::util::FrameworkNode::FrameworkNode(const OutputVector& inputs, size_t output_size, size_t num_subgraphs) : MultiSubGraphOp(num_subgraphs), diff --git a/src/core/src/op/util/gather_base.cpp b/src/core/src/op/util/gather_base.cpp index beb96ba03ae..fc8e45bcdef 100644 --- a/src/core/src/op/util/gather_base.cpp +++ b/src/core/src/op/util/gather_base.cpp @@ -2,19 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/gather_base.hpp" +#include "openvino/op/util/gather_base.hpp" #include "bound_evaluate.hpp" #include "gather_shape_inference.hpp" #include "itt.hpp" -#include "ngraph/op/concat.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/squeeze.hpp" -#include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/gather.hpp" -#include "ngraph/shape.hpp" - -using namespace std; +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/squeeze.hpp" ov::op::util::GatherBase::GatherBase(const Output& data, const Output& indices, @@ -143,9 +139,9 @@ bool cf_gather_with_subgraph(ov::OutputVector& output_values, return false; } - const auto concat = std::dynamic_pointer_cast(input_values[0].get_node_shared_ptr()); - const auto indices = std::dynamic_pointer_cast(input_values[1].get_node_shared_ptr()); - const auto axis = std::dynamic_pointer_cast(input_values[2].get_node_shared_ptr()); + const auto concat = std::dynamic_pointer_cast(input_values[0].get_node_shared_ptr()); + const auto indices = std::dynamic_pointer_cast(input_values[1].get_node_shared_ptr()); + const auto axis = std::dynamic_pointer_cast(input_values[2].get_node_shared_ptr()); if (!concat || !indices || !axis) { return false; @@ -173,7 +169,7 @@ bool cf_gather_with_subgraph(ov::OutputVector& output_values, const int64_t rank = concat->get_shape()[0]; const int64_t raw_index = indices->cast_vector()[0]; const int64_t positive_index = raw_index < 0 ? rank + raw_index : raw_index; - NGRAPH_CHECK(positive_index >= 0 && positive_index < rank); + OPENVINO_ASSERT(positive_index >= 0 && positive_index < rank); // gather takes exactly one element out of the Concat output const auto gathered_concat_input = concat_inputs[positive_index].get_source_output().get_node_shared_ptr(); @@ -181,8 +177,8 @@ bool cf_gather_with_subgraph(ov::OutputVector& output_values, auto gathered = gathered_concat_input; if (indices_shape.empty()) { // gathering a scalar - const auto axis_const = ngraph::op::Constant::create(ov::element::i64, ov::Shape{1}, {0}); - gathered = make_shared(gathered_concat_input, axis_const); + const auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{1}, {0}); + gathered = std::make_shared(gathered_concat_input, axis_const); } output_values[0] = gathered; @@ -195,8 +191,8 @@ bool cf_gather_with_subgraph(ov::OutputVector& output_values, bool ov::op::util::GatherBase::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const { OV_OP_SCOPE(util_GatherBase_evaluate); OPENVINO_SUPPRESS_DEPRECATED_START - NGRAPH_CHECK(ngraph::validate_host_tensor_vector(inputs, 3)); - NGRAPH_CHECK(ngraph::validate_host_tensor_vector(outputs, 1)); + OPENVINO_ASSERT(ngraph::validate_host_tensor_vector(inputs, 3)); + OPENVINO_ASSERT(ngraph::validate_host_tensor_vector(outputs, 1)); OPENVINO_SUPPRESS_DEPRECATED_END int64_t axis = 0; switch (inputs[2]->get_element_type()) { diff --git a/src/core/src/op/util/gather_nd_base.cpp b/src/core/src/op/util/gather_nd_base.cpp index 5276273699f..5229c29dfd6 100644 --- a/src/core/src/op/util/gather_nd_base.cpp +++ b/src/core/src/op/util/gather_nd_base.cpp @@ -2,18 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/gather_nd_base.hpp" - -#include +#include "openvino/op/util/gather_nd_base.hpp" #include "gather_nd_shape_inference.hpp" -#include "ngraph/op/concat.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/squeeze.hpp" -#include "ngraph/runtime/host_tensor.hpp" -#include "ngraph/shape.hpp" - -using namespace std; ov::op::util::GatherNDBase::GatherNDBase(const Output& data, const Output& indices, const size_t batch_dims) : Op({data, indices}), diff --git a/src/core/src/op/util/index_reduction.cpp b/src/core/src/op/util/index_reduction.cpp index c71d9bd55a1..67802295f60 100644 --- a/src/core/src/op/util/index_reduction.cpp +++ b/src/core/src/op/util/index_reduction.cpp @@ -2,14 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/index_reduction.hpp" +#include "openvino/op/util/index_reduction.hpp" #include #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" - -using namespace std; ov::op::util::IndexReduction::IndexReduction() = default; diff --git a/src/core/src/op/util/logical_reduction.cpp b/src/core/src/op/util/logical_reduction.cpp index 4233a127cb1..e8e19a5952d 100644 --- a/src/core/src/op/util/logical_reduction.cpp +++ b/src/core/src/op/util/logical_reduction.cpp @@ -2,22 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/logical_reduction.hpp" +#include "openvino/op/util/logical_reduction.hpp" #include "itt.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/validation_util.hpp" +#include "openvino/op/constant.hpp" namespace ov { -using namespace std; - op::util::LogicalReduction::LogicalReduction() = default; op::util::LogicalReduction::LogicalReduction(const Output& arg, const AxisSet& reduction_axes) : ReductionBase( arg, - ngraph::op::Constant::create(element::i64, ov::Shape{reduction_axes.size()}, reduction_axes.to_vector()) + ov::op::v0::Constant::create(element::i64, ov::Shape{reduction_axes.size()}, reduction_axes.to_vector()) ->output(0)) {} op::util::LogicalReduction::LogicalReduction(const Output& arg, const Output& reduction_axes) diff --git a/src/core/src/op/util/logical_reduction_keep_dims.cpp b/src/core/src/op/util/logical_reduction_keep_dims.cpp index 9ae830f93c0..b4fe89a7d38 100644 --- a/src/core/src/op/util/logical_reduction_keep_dims.cpp +++ b/src/core/src/op/util/logical_reduction_keep_dims.cpp @@ -2,17 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/logical_reduction_keep_dims.hpp" +#include "openvino/op/util/logical_reduction_keep_dims.hpp" #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/validation_util.hpp" -using namespace std; - -ov::op::util::LogicalReductionKeepDims::LogicalReductionKeepDims(const ngraph::Output& arg, - const ngraph::Output& reduction_axes, +ov::op::util::LogicalReductionKeepDims::LogicalReductionKeepDims(const ov::Output& arg, + const ov::Output& reduction_axes, const bool keep_dims) : LogicalReduction(arg, reduction_axes), m_keep_dims{keep_dims} {} diff --git a/src/core/src/op/util/multi_subgraph_base.cpp b/src/core/src/op/util/multi_subgraph_base.cpp index fa7da5aadae..ea650cec7dd 100644 --- a/src/core/src/op/util/multi_subgraph_base.cpp +++ b/src/core/src/op/util/multi_subgraph_base.cpp @@ -2,10 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/multi_subgraph_base.hpp" - -#include "ngraph/graph_util.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/util/multi_subgraph_base.hpp" ov::op::util::MultiSubGraphOp::InputDescription::InputDescription(uint64_t input_index, uint64_t body_parameter_index) : m_input_index(input_index), @@ -117,7 +114,7 @@ ov::Input ov::op::util::MultiSubGraphOp::input_for_value(const Output< } void ov::op::util::MultiSubGraphOp::set_invariant_inputs(const Output& value, - const ngraph::ParameterVector& bodies_parameters) { + const ov::ParameterVector& bodies_parameters) { auto input_index = input_for_value(value).get_index(); for (auto& param : bodies_parameters) { for (size_t body_index = 0; body_index < m_bodies.size(); ++body_index) { diff --git a/src/core/src/op/util/op_types.cpp b/src/core/src/op/util/op_types.cpp index 9b100a24025..2e5763b52a3 100644 --- a/src/core/src/op/util/op_types.cpp +++ b/src/core/src/op/util/op_types.cpp @@ -2,28 +2,28 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/op_types.hpp" +#include "openvino/op/util/op_types.hpp" -#include "ngraph/op/add.hpp" -#include "ngraph/op/and.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/equal.hpp" -#include "ngraph/op/maximum.hpp" -#include "ngraph/op/minimum.hpp" -#include "ngraph/op/multiply.hpp" -#include "ngraph/op/not_equal.hpp" -#include "ngraph/op/op.hpp" -#include "ngraph/op/or.hpp" -#include "ngraph/op/parameter.hpp" -#include "ngraph/op/result.hpp" -#include "ngraph/op/select.hpp" -#include "ngraph/op/squared_difference.hpp" -#include "ngraph/op/util/binary_elementwise_arithmetic.hpp" -#include "ngraph/op/util/binary_elementwise_comparison.hpp" -#include "ngraph/op/util/binary_elementwise_logical.hpp" -#include "ngraph/op/util/unary_elementwise_arithmetic.hpp" -#include "ngraph/op/xor.hpp" -#include "ngraph/type.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/equal.hpp" +#include "openvino/op/logical_and.hpp" +#include "openvino/op/logical_or.hpp" +#include "openvino/op/logical_xor.hpp" +#include "openvino/op/maximum.hpp" +#include "openvino/op/minimum.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/not_equal.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/select.hpp" +#include "openvino/op/sink.hpp" +#include "openvino/op/squared_difference.hpp" +#include "openvino/op/util/binary_elementwise_arithmetic.hpp" +#include "openvino/op/util/binary_elementwise_comparison.hpp" +#include "openvino/op/util/binary_elementwise_logical.hpp" +#include "openvino/op/util/unary_elementwise_arithmetic.hpp" +#include "openvino/op/xor.hpp" bool ov::op::util::is_unary_elementwise_arithmetic(const ov::Node* node) { return dynamic_cast(node) != nullptr; @@ -42,8 +42,8 @@ bool ov::op::util::is_binary_elementwise_logical(const ov::Node* node) { } bool ov::op::util::supports_auto_broadcast(const ov::Node* node) { - return dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || + return dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || dynamic_cast(node) != nullptr || dynamic_cast(node) != nullptr || dynamic_cast(node) != nullptr; @@ -54,32 +54,32 @@ bool ov::op::util::is_op(const ov::Node* node) { } bool ov::op::util::is_parameter(const ov::Node* node) { - return dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr; } bool ov::op::util::is_output(const ov::Node* node) { - return dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr; } bool ov::op::util::is_sink(const ov::Node* node) { - return dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr; } bool ov::op::util::is_constant(const ov::Node* node) { - return dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr; } bool ov::op::util::is_commutative(const ov::Node* node) { - return dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr || - dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr || + dynamic_cast(node) != nullptr; } bool ov::op::util::is_unary_elementwise_arithmetic(const std::shared_ptr& node) { diff --git a/src/core/src/op/util/reduction_base.cpp b/src/core/src/op/util/reduction_base.cpp index f00b01371af..dbe7cb4b522 100644 --- a/src/core/src/op/util/reduction_base.cpp +++ b/src/core/src/op/util/reduction_base.cpp @@ -7,8 +7,6 @@ #include "openvino/op/constant.hpp" #include "reduce_shape_inference.hpp" -using namespace std; - ov::op::util::ReductionBase::ReductionBase() = default; ov::op::util::ReductionBase::ReductionBase(const Output& arg, const Output& reduction_axes) diff --git a/src/core/src/op/util/rnn_cell_base.cpp b/src/core/src/op/util/rnn_cell_base.cpp index e2284677d89..c129054c269 100644 --- a/src/core/src/op/util/rnn_cell_base.cpp +++ b/src/core/src/op/util/rnn_cell_base.cpp @@ -2,22 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/rnn_cell_base.hpp" +#include "openvino/op/util/rnn_cell_base.hpp" #include #include #include #include "itt.hpp" -#include "ngraph/attribute_visitor.hpp" -#include "ngraph/op/add.hpp" -#include "ngraph/op/clamp.hpp" -#include "ngraph/op/multiply.hpp" -#include "ngraph/op/subtract.hpp" -#include "ngraph/opsets/opset4.hpp" -#include "ngraph/util.hpp" - -using namespace std; +#include "openvino/op/add.hpp" +#include "openvino/op/clamp.hpp" +#include "openvino/op/concat.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/split.hpp" +#include "openvino/op/subtract.hpp" +#include "openvino/util/common_util.hpp" std::shared_ptr ov::op::util::convert_lstm_node_format(const Output& node, LSTMWeightsFormat from_format, @@ -34,13 +33,13 @@ std::shared_ptr ov::op::util::convert_lstm_node_format(const Output(element::i64, ngraph::Shape{}, axis); - OutputVector splitted_node = std::make_shared(node, axis_const, num_gates)->outputs(); + auto axis_const = std::make_shared(element::i64, ov::Shape{}, axis); + OutputVector splitted_node = std::make_shared(node, axis_const, num_gates)->outputs(); OutputVector nodes_in_new_format(num_gates); for (size_t i = 0; i < num_gates; ++i) { nodes_in_new_format[to[from[i]]] = splitted_node[i]; } - return std::make_shared(nodes_in_new_format, axis); + return std::make_shared(nodes_in_new_format, axis); } std::shared_ptr ov::op::util::convert_lstm_peepholes_format(const Output& node, @@ -56,22 +55,20 @@ std::shared_ptr ov::op::util::convert_lstm_peepholes_format(const Outp const auto& to = gate_order_map.at(to_format); size_t num_gates = 3; - auto axis_const = std::make_shared(element::i64, ngraph::Shape{}, axis); - OutputVector splitted_node = std::make_shared(node, axis_const, num_gates)->outputs(); + auto axis_const = std::make_shared(element::i64, ov::Shape{}, axis); + OutputVector splitted_node = std::make_shared(node, axis_const, num_gates)->outputs(); OutputVector nodes_in_new_format(num_gates); for (size_t i = 0; i < num_gates; ++i) { nodes_in_new_format[to[from[i]]] = splitted_node[i]; } - return std::make_shared(nodes_in_new_format, axis); + return std::make_shared(nodes_in_new_format, axis); } // Modify input vector in-place and return reference to modified vector. -static vector to_lower_case(const vector& vs) { - vector res(vs); - transform(begin(res), end(res), begin(res), [](string& s) { - OPENVINO_SUPPRESS_DEPRECATED_START - return ngraph::to_lower(s); - OPENVINO_SUPPRESS_DEPRECATED_END +static std::vector to_lower_case(const std::vector& vs) { + std::vector res(vs); + transform(begin(res), end(res), begin(res), [](std::string& s) { + return ov::util::to_lower(s); }); return res; } @@ -81,9 +78,9 @@ ov::op::util::RNNCellBase::RNNCellBase() : m_hidden_size(0), m_clip(0.f) {} ov::op::util::RNNCellBase::RNNCellBase(const OutputVector& args, size_t hidden_size, float clip, - const vector& activations, - const vector& activations_alpha, - const vector& activations_beta) + const std::vector& activations, + const std::vector& activations_alpha, + const std::vector& activations_beta) : Op(args), m_hidden_size(hidden_size), m_clip(clip), @@ -91,7 +88,7 @@ ov::op::util::RNNCellBase::RNNCellBase(const OutputVector& args, m_activations_alpha(activations_alpha), m_activations_beta(activations_beta) {} -bool ngraph::op::util::RNNCellBase::visit_attributes(AttributeVisitor& visitor) { +bool ov::op::util::RNNCellBase::visit_attributes(AttributeVisitor& visitor) { OV_OP_SCOPE(util_RNNCellBase_visit_attributes); visitor.on_attribute("hidden_size", m_hidden_size); visitor.on_attribute("activations", m_activations); @@ -101,7 +98,7 @@ bool ngraph::op::util::RNNCellBase::visit_attributes(AttributeVisitor& visitor) return true; } -void ngraph::op::util::RNNCellBase::validate_input_rank_dimension(const std::vector& input) { +void ov::op::util::RNNCellBase::validate_input_rank_dimension(const std::vector& input) { enum { X, initial_hidden_state, W, R, B }; // Verify static ranks for all inputs @@ -159,22 +156,22 @@ ov::op::util::ActivationFunction ov::op::util::RNNCellBase::get_activation_funct return afunc; } -shared_ptr ov::op::util::RNNCellBase::add(const Output& lhs, const Output& rhs) { - return {make_shared(lhs, rhs)}; +std::shared_ptr ov::op::util::RNNCellBase::add(const Output& lhs, const Output& rhs) { + return {std::make_shared(lhs, rhs)}; } -shared_ptr ov::op::util::RNNCellBase::sub(const Output& lhs, const Output& rhs) { - return {make_shared(lhs, rhs)}; +std::shared_ptr ov::op::util::RNNCellBase::sub(const Output& lhs, const Output& rhs) { + return {std::make_shared(lhs, rhs)}; } -shared_ptr ov::op::util::RNNCellBase::mul(const Output& lhs, const Output& rhs) { - return {make_shared(lhs, rhs)}; +std::shared_ptr ov::op::util::RNNCellBase::mul(const Output& lhs, const Output& rhs) { + return {std::make_shared(lhs, rhs)}; } -shared_ptr ov::op::util::RNNCellBase::clip(const Output& data) const { +std::shared_ptr ov::op::util::RNNCellBase::clip(const Output& data) const { if (m_clip == 0.f) { return data.get_node_shared_ptr(); } - return make_shared(data, -m_clip, m_clip); + return std::make_shared(data, -m_clip, m_clip); } diff --git a/src/core/src/op/util/scatter_base.cpp b/src/core/src/op/util/scatter_base.cpp index 643ce1a99d5..8ae559ffbc3 100644 --- a/src/core/src/op/util/scatter_base.cpp +++ b/src/core/src/op/util/scatter_base.cpp @@ -2,14 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/scatter_base.hpp" +#include "openvino/op/util/scatter_base.hpp" #include "itt.hpp" -#include "ngraph/op/util/op_types.hpp" -#include "ngraph/shape.hpp" -#include "ngraph/validation_util.hpp" - -using namespace std; +#include "openvino/core/validation_util.hpp" ov::op::util::ScatterBase::ScatterBase(const Output& data, const Output& indices, @@ -76,12 +72,10 @@ void ov::op::util::ScatterBase::validate_and_infer_types() { // Get axis value if possible. OPENVINO_SUPPRESS_DEPRECATED_START if (const auto& axis_const_input = get_constant_from_source(input_value(AXIS))) { - OPENVINO_SUPPRESS_DEPRECATED_END bool compatible = true; int64_t axis = axis_const_input->cast_vector().at(0); int64_t data_rank = data_shape.rank().get_length(); - OPENVINO_SUPPRESS_DEPRECATED_START - axis = ngraph::normalize_axis(this, axis, data_rank); + axis = ov::normalize_axis(this, axis, data_rank); OPENVINO_SUPPRESS_DEPRECATED_END if (indices_shape.rank().is_static() && updates_shape.rank().is_static()) { diff --git a/src/core/src/op/util/scatter_elements_update_base.cpp b/src/core/src/op/util/scatter_elements_update_base.cpp index 768737794a7..66beafb6b42 100644 --- a/src/core/src/op/util/scatter_elements_update_base.cpp +++ b/src/core/src/op/util/scatter_elements_update_base.cpp @@ -4,11 +4,10 @@ #include "openvino/op/util/scatter_elements_update_base.hpp" -#include - #include "bound_evaluate.hpp" #include "itt.hpp" #include "openvino/core/validation_util.hpp" +#include "scatter_elements_update_shape_inference.hpp" namespace ov { namespace op { @@ -109,7 +108,7 @@ bool op::util::ScatterElementsUpdateBase::evaluate_label(TensorLabelVector& outp OPENVINO_SUPPRESS_DEPRECATED_START int64_t op::util::ScatterElementsUpdateBase::get_normalized_axis(const HostTensorVector& inputs) const { - NGRAPH_CHECK(inputs[3]->get_element_type().is_integral_number(), "axis element type is not integral data type"); + OPENVINO_ASSERT(inputs[3]->get_element_type().is_integral_number(), "axis element type is not integral data type"); OPENVINO_SUPPRESS_DEPRECATED_START int64_t axis = host_tensor_2_vector(inputs[3])[0]; @@ -120,11 +119,11 @@ int64_t op::util::ScatterElementsUpdateBase::get_normalized_axis(const HostTenso if (normalized_axis < 0) { if (input_rank.is_static()) { OPENVINO_SUPPRESS_DEPRECATED_START - normalized_axis = ngraph::normalize_axis(this, axis, input_rank); + normalized_axis = ov::normalize_axis(this, axis, input_rank); OPENVINO_SUPPRESS_DEPRECATED_END } else { OPENVINO_SUPPRESS_DEPRECATED_START - normalized_axis = ngraph::normalize_axis(this, axis, static_cast(inputs[0]->get_shape().size())); + normalized_axis = ov::normalize_axis(this, axis, static_cast(inputs[0]->get_shape().size())); OPENVINO_SUPPRESS_DEPRECATED_END } } diff --git a/src/core/src/op/util/scatter_nd_base.cpp b/src/core/src/op/util/scatter_nd_base.cpp index 766ab15cf31..31b93020018 100644 --- a/src/core/src/op/util/scatter_nd_base.cpp +++ b/src/core/src/op/util/scatter_nd_base.cpp @@ -2,15 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/scatter_nd_base.hpp" - -#include +#include "openvino/op/util/scatter_nd_base.hpp" #include "itt.hpp" -#include "ngraph/node.hpp" -#include "ngraph/shape.hpp" - -using namespace std; +#include "scatter_nd_base_shape_inference.hpp" constexpr int ov::op::util::ScatterNDBase::INPUTS; constexpr int ov::op::util::ScatterNDBase::INDICES; diff --git a/src/core/src/op/util/sub_graph_base.cpp b/src/core/src/op/util/sub_graph_base.cpp index 8031d9775e5..c51c6a61764 100644 --- a/src/core/src/op/util/sub_graph_base.cpp +++ b/src/core/src/op/util/sub_graph_base.cpp @@ -2,31 +2,31 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/sub_graph_base.hpp" +#include "openvino/op/util/sub_graph_base.hpp" -#include "ngraph/graph_util.hpp" -#include "ngraph/opsets/opset5.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/tensor_iterator.hpp" ov::op::util::SubGraphOp::SubGraphOp() : MultiSubGraphOp(1) {} ov::op::util::SubGraphOp::SubGraphOp(const OutputVector& args) : MultiSubGraphOp(args, 1) {} -void ov::op::util::SubGraphOp::set_merged_input(const std::shared_ptr& body_parameter, +void ov::op::util::SubGraphOp::set_merged_input(const std::shared_ptr& body_parameter, const Output& initial_value, const Output& successive_value) { auto body = get_function(); m_input_descriptions[0].push_back( - std::make_shared(input_for_value(initial_value).get_index(), + std::make_shared(input_for_value(initial_value).get_index(), body->get_parameter_index(body_parameter), body->get_result_index(successive_value))); validate_and_infer_types(); } -void ov::op::util::SubGraphOp::set_invariant_input(const std::shared_ptr& body_parameter, +void ov::op::util::SubGraphOp::set_invariant_input(const std::shared_ptr& body_parameter, const Output& value) { auto body = get_function(); - m_input_descriptions[0].push_back(std::make_shared( + m_input_descriptions[0].push_back(std::make_shared( input_for_value(value).get_index(), body->get_parameter_index(body_parameter))); validate_and_infer_types(); @@ -62,7 +62,7 @@ ov::Output ov::op::util::SubGraphOp::get_concatenated_slices(const Out return Output(shared_from_this(), output_index); } -void ov::op::util::SubGraphOp::set_sliced_input(const std::shared_ptr& parameter, +void ov::op::util::SubGraphOp::set_sliced_input(const std::shared_ptr& parameter, const Output& value, int64_t start, int64_t stride, diff --git a/src/core/src/op/util/topk_base.cpp b/src/core/src/op/util/topk_base.cpp index 0327e1ac0d2..710f54d87ec 100644 --- a/src/core/src/op/util/topk_base.cpp +++ b/src/core/src/op/util/topk_base.cpp @@ -5,11 +5,10 @@ #include "openvino/op/util/topk_base.hpp" #include -#include -#include #include "itt.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" +#include "topk_shape_inference.hpp" namespace { constexpr auto UNKNOWN_NORMALIZED_AXIS = std::numeric_limits::max(); diff --git a/src/core/src/op/util/unary_elementwise_arithmetic.cpp b/src/core/src/op/util/unary_elementwise_arithmetic.cpp index 10b1fbdfd33..737e8398a7e 100644 --- a/src/core/src/op/util/unary_elementwise_arithmetic.cpp +++ b/src/core/src/op/util/unary_elementwise_arithmetic.cpp @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ngraph/op/util/unary_elementwise_arithmetic.hpp" +#include "openvino/op/util/unary_elementwise_arithmetic.hpp" #include "itt.hpp" -#include "ngraph/op/util/elementwise_args.hpp" ov::op::util::UnaryElementwiseArithmetic::UnaryElementwiseArithmetic() : Op() {} diff --git a/src/core/src/op/util/variable_value.cpp b/src/core/src/op/util/variable_value.cpp index b2526a3327e..6f561a9fb6d 100644 --- a/src/core/src/op/util/variable_value.cpp +++ b/src/core/src/op/util/variable_value.cpp @@ -6,7 +6,6 @@ #include -#include "ngraph/node.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "openvino/core/deprecated.hpp" #include "openvino/core/shape.hpp"