diff --git a/docs/snippets/lpt_intel_cpu_plugin.cpp b/docs/snippets/lpt_intel_cpu_plugin.cpp index 906e6aeb39f..5d491346aa2 100644 --- a/docs/snippets/lpt_intel_cpu_plugin.cpp +++ b/docs/snippets/lpt_intel_cpu_plugin.cpp @@ -10,6 +10,7 @@ #include #include #include +#include "openvino/pass/manager.hpp" namespace ngraph { namespace pass { @@ -28,7 +29,7 @@ public: int main() { std::shared_ptr nGraphFunc; -ngraph::pass::Manager manager; +ov::pass::Manager manager; auto pass_config = manager.get_pass_config(); //! [lpt_common] // check if the function is quantized to ignore LPT transformations for not quantized function to speed up model loading @@ -69,19 +70,19 @@ using namespace ngraph::pass::low_precision; if (useLpt) { // Low precision transformations plugin specific configuration: restrictions definition auto supportedPrecisions = std::vector({ - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}, }), - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8, ngraph::element::i8}}, {{1}, {ngraph::element::i8}} }), - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}} }), - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}, }), @@ -89,17 +90,17 @@ if (useLpt) { // Low precision transformations plugin specific configuration: per-tensor quantization operations definition auto perTensorQuantization = std::vector({ - QuantizationGranularityRestriction::create({0}), - QuantizationGranularityRestriction::create({0}) + QuantizationGranularityRestriction::create({0}), + QuantizationGranularityRestriction::create({0}) }); // Low precision transformations instantiation and registration in pass manager - ngraph::pass::Manager lptManager; + ov::pass::Manager lptManager; lptManager.register_pass(supportedPrecisions, perTensorQuantization); // Low precision transformations plugin specific configuration: transformation callbacks definition lptManager.get_pass_config()->set_callback([](const std::shared_ptr& node) -> bool { - if (const auto multiply = std::dynamic_pointer_cast(node)) { + if (const auto multiply = std::dynamic_pointer_cast(node)) { return !MultiplyToGroupConvolutionTransformation::canBeTransformedToGroupConvolution(multiply); } return false; @@ -117,7 +118,7 @@ if (useLpt) { //! [lpt_execution] //! [lpt_device] -ngraph::pass::Manager deviceSpecificManager; +ov::pass::Manager deviceSpecificManager; deviceSpecificManager.register_pass(); deviceSpecificManager.run_passes(nGraphFunc); //! [lpt_device] @@ -127,23 +128,23 @@ return 0; int lpt_supported_precisions() { std::shared_ptr nGraphFunc; -ngraph::pass::Manager manager; +ov::pass::Manager manager; using namespace ngraph::pass::low_precision; //! [lpt_supported_precisions] auto supportedPrecisions = std::vector({ - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}, }), }); -ngraph::pass::Manager lptManager; +ov::pass::Manager lptManager; lptManager.register_pass(supportedPrecisions); lptManager.run_passes(nGraphFunc); //! [lpt_supported_precisions] -ngraph::pass::Manager deviceSpecificManager; +ov::pass::Manager deviceSpecificManager; deviceSpecificManager.register_pass(); deviceSpecificManager.run_passes(nGraphFunc); @@ -158,10 +159,10 @@ using namespace ngraph::pass::low_precision; const std::vector emptyRestrictions; auto perTensorQuantization = std::vector({ - QuantizationGranularityRestriction::create({0}) + QuantizationGranularityRestriction::create({0}) }); -ngraph::pass::Manager lptManager; +ov::pass::Manager lptManager; lptManager.register_pass(emptyRestrictions, perTensorQuantization); lptManager.run_passes(nGraphFunc); //! [per_tensor_quantization] @@ -171,13 +172,13 @@ return 0; int asymmetric_quantization(const std::vector& defaultPrecisions) { std::shared_ptr nGraphFunc; -ngraph::pass::Manager manager; +ov::pass::Manager manager; auto pass_config = manager.get_pass_config(); //! [asymmetric_quantization] using namespace ngraph::pass::low_precision; -ngraph::pass::Manager lptManager; +ov::pass::Manager lptManager; lptManager.register_pass(); lptManager.get_pass_config()->set_callback([&defaultPrecisions](const std::shared_ptr& node) -> bool { @@ -191,27 +192,27 @@ return 0; int lpt_markup_pipeline() { std::shared_ptr nGraphFunc; -ngraph::pass::Manager manager; +ov::pass::Manager manager; using namespace ngraph::pass::low_precision; //! [lpt_markup_pipeline] auto supportedPrecisions = std::vector({ - PrecisionsRestriction::create({ + PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}, }), }); auto perTensorQuantization = std::vector({ - QuantizationGranularityRestriction::create({0}) + QuantizationGranularityRestriction::create({0}) }); -ngraph::pass::Manager lptManager; +ov::pass::Manager lptManager; lptManager.register_pass(supportedPrecisions, perTensorQuantization); lptManager.run_passes(nGraphFunc); //! [lpt_markup_pipeline] -ngraph::pass::Manager deviceSpecificManager; +ov::pass::Manager deviceSpecificManager; deviceSpecificManager.register_pass(); deviceSpecificManager.run_passes(nGraphFunc); diff --git a/docs/snippets/ngraph.cpp b/docs/snippets/ngraph.cpp index 931140f99d9..a90257b7e20 100644 --- a/docs/snippets/ngraph.cpp +++ b/docs/snippets/ngraph.cpp @@ -1,8 +1,7 @@ // Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // -#include -#include +#include int main() { //! [ngraph:graph] @@ -26,23 +25,21 @@ int main() { // | Result | // | result | // |_____________| - auto data1 = std::make_shared(ngraph::element::i64, ngraph::Shape{1, 3, 2, 2}); + auto data1 = std::make_shared(ov::element::i64, ov::Shape{1, 3, 2, 2}); data1->set_friendly_name("data1"); // operation name data1->output(0).set_names({"data1_t"}); // tensor names - auto data2 = std::make_shared(ngraph::element::i64, ngraph::Shape{1, 2, 2, 2}); + auto data2 = std::make_shared(ov::element::i64, ov::Shape{1, 2, 2, 2}); data2->set_friendly_name("data2"); // operation name data2->output(0).set_names({"data2_t"}); // tensor names - auto concat = std::make_shared(ngraph::OutputVector{data1, data2}, 1); + auto concat = std::make_shared(ov::OutputVector{data1, data2}, 1); concat->set_friendly_name("concat"); // operation name concat->output(0).set_names({"concat_t"}); // tensor name - auto result = std::make_shared(concat); + auto result = std::make_shared(concat); result->set_friendly_name("result"); // operation name - auto f = std::make_shared(ngraph::ResultVector{result}, - ngraph::ParameterVector{data1, data2}, - "function_name"); + auto f = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{data1, data2}, "function_name"); //! [ngraph:graph] return 0; } diff --git a/src/bindings/python/src/pyopenvino/graph/node_factory.cpp b/src/bindings/python/src/pyopenvino/graph/node_factory.cpp index 82837f311c8..b117c45bb09 100644 --- a/src/bindings/python/src/pyopenvino/graph/node_factory.cpp +++ b/src/bindings/python/src/pyopenvino/graph/node_factory.cpp @@ -18,12 +18,12 @@ #include "dict_attribute_visitor.hpp" #include "ngraph/check.hpp" -#include "ngraph/log.hpp" #include "openvino/core/except.hpp" #include "openvino/core/node.hpp" #include "openvino/op/util/op_types.hpp" #include "openvino/op/util/variable.hpp" #include "openvino/opsets/opset.hpp" +#include "openvino/util/log.hpp" #include "pyopenvino/core/common.hpp" namespace py = pybind11; @@ -61,7 +61,7 @@ public: "Currently NodeFactory doesn't support Constant node: ", op_type_name); - NGRAPH_WARN << "Empty op created! Please assign inputs and attributes and run validate() before op is used."; + OPENVINO_WARN << "Empty op created! Please assign inputs and attributes and run validate() before op is used."; return op_node; } diff --git a/src/bindings/python/src/pyopenvino/graph/ops/if.cpp b/src/bindings/python/src/pyopenvino/graph/ops/if.cpp index 9e0976c44c8..13de82c7acd 100644 --- a/src/bindings/python/src/pyopenvino/graph/ops/if.cpp +++ b/src/bindings/python/src/pyopenvino/graph/ops/if.cpp @@ -6,9 +6,9 @@ #include -#include "ngraph/log.hpp" #include "openvino/core/node.hpp" #include "openvino/op/util/multi_subgraph_base.hpp" +#include "openvino/util/log.hpp" #include "pyopenvino/core/common.hpp" #include "pyopenvino/graph/ops/if.hpp" #include "pyopenvino/graph/ops/util/multisubgraph.hpp" @@ -24,8 +24,8 @@ void regclass_graph_op_If(py::module m) { if (MultiSubgraphHelpers::is_constant_or_parameter(execution_condition)) { return std::make_shared(execution_condition->output(0)); } else { - NGRAPH_WARN << "Please specify execution_condition as Constant or Parameter. Default If() " - "constructor was applied."; + OPENVINO_WARN << "Please specify execution_condition as Constant or Parameter. Default If() " + "constructor was applied."; return std::make_shared(); } }), diff --git a/src/bindings/python/src/pyopenvino/graph/ops/loop.cpp b/src/bindings/python/src/pyopenvino/graph/ops/loop.cpp index f5a2562d98f..c378c9cbe32 100644 --- a/src/bindings/python/src/pyopenvino/graph/ops/loop.cpp +++ b/src/bindings/python/src/pyopenvino/graph/ops/loop.cpp @@ -6,9 +6,9 @@ #include -#include "ngraph/log.hpp" #include "openvino/core/node.hpp" #include "openvino/op/loop.hpp" +#include "openvino/util/log.hpp" #include "pyopenvino/core/common.hpp" #include "pyopenvino/graph/ops/util/multisubgraph.hpp" @@ -28,7 +28,7 @@ void regclass_graph_op_Loop(py::module m) { MultiSubgraphHelpers::is_constant_or_parameter(execution_condition)) { return std::make_shared(trip_count->output(0), execution_condition->output(0)); } else { - NGRAPH_WARN + OPENVINO_WARN << "Please specify execution_condition and trip_count as Constant or Parameter. Default Loop() " "constructor was applied."; return std::make_shared(); diff --git a/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp b/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp index 1a505b74a59..e25a3244082 100644 --- a/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp +++ b/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp @@ -5,9 +5,9 @@ #pragma once #include -#include #include "low_precision/lpt_visibility.hpp" #include "low_precision/layer_transformation.hpp" +#include "openvino/pass/pass.hpp" namespace ngraph { namespace pass { @@ -28,11 +28,11 @@ class LP_TRANSFORMATIONS_API AlignQuantizationIntervals; * [AlignQuantizationIntervals](@ref openvino_docs_OV_UG_lpt_AlignQuantizationIntervals) page * in the Inference Engine Developer Guide. */ -class ngraph::pass::low_precision::AlignQuantizationIntervals : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::AlignQuantizationIntervals : public ov::pass::ModelPass { public: OPENVINO_RTTI("AlignQuantizationIntervals", "0"); - AlignQuantizationIntervals(const std::vector& defaultPrecisions = ngraph::pass::low_precision::precision_set::int8_support); - bool run_on_model(const std::shared_ptr& m) override; + AlignQuantizationIntervals(const std::vector& defaultPrecisions = ngraph::pass::low_precision::precision_set::int8_support); + bool run_on_model(const std::shared_ptr& m) override; private: const std::vector defaultPrecisions; }; diff --git a/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp b/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp index 17905c36080..f2a5465586d 100644 --- a/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp +++ b/src/common/low_precision_transformations/include/low_precision/avg_pool.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API AvgPoolTransformation : public LayerTransformation public: OPENVINO_RTTI("AvgPoolTransformation", "0"); AvgPoolTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/common/fake_quantize_dequantization.hpp b/src/common/low_precision_transformations/include/low_precision/common/fake_quantize_dequantization.hpp index f839c007fb1..774e0ac26c9 100644 --- a/src/common/low_precision_transformations/include/low_precision/common/fake_quantize_dequantization.hpp +++ b/src/common/low_precision_transformations/include/low_precision/common/fake_quantize_dequantization.hpp @@ -6,15 +6,15 @@ #include #include -#include -#include #include +#include "openvino/core/node.hpp" +#include "openvino/opsets/opset1.hpp" namespace ngraph { namespace pass { namespace low_precision { -typedef std::tuple, std::shared_ptr> FakeQuantizeDequantizationValues; +typedef std::tuple, std::shared_ptr> FakeQuantizeDequantizationValues; class LP_TRANSFORMATIONS_API FakeQuantizeDequantization { public: @@ -22,12 +22,12 @@ public: FakeQuantizeDequantization( const Output& data, - const std::shared_ptr& convert, - const std::shared_ptr& subtract, - const std::shared_ptr& subtractConvert, - const std::shared_ptr& subtractConstant, - const std::shared_ptr& multiply, - const std::shared_ptr& multiplyConstant); + const std::shared_ptr& convert, + const std::shared_ptr& subtract, + const std::shared_ptr& subtractConvert, + const std::shared_ptr& subtractConstant, + const std::shared_ptr& multiply, + const std::shared_ptr& multiplyConstant); bool empty() const noexcept; bool multiplyHasZeroOrDenormal() const; @@ -41,21 +41,21 @@ public: static int fillDequantizationParams( const std::shared_ptr& elementwise, - std::shared_ptr& convert, - std::shared_ptr& constant); + std::shared_ptr& convert, + std::shared_ptr& constant); static int fillDequantizationParams( const std::shared_ptr& elementwise, - std::shared_ptr& constant); + std::shared_ptr& constant); size_t channelDimIndex; Output data; - std::shared_ptr convert; - std::shared_ptr subtract; - std::shared_ptr subtractConvert; - std::shared_ptr subtractConstant; - std::shared_ptr multiply; - std::shared_ptr multiplyConstant; + std::shared_ptr convert; + std::shared_ptr subtract; + std::shared_ptr subtractConvert; + std::shared_ptr subtractConstant; + std::shared_ptr multiply; + std::shared_ptr multiplyConstant; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/common/port_quantization_granularity_restriction.hpp b/src/common/low_precision_transformations/include/low_precision/common/port_quantization_granularity_restriction.hpp index 4459a32d32e..388aa8d7609 100644 --- a/src/common/low_precision_transformations/include/low_precision/common/port_quantization_granularity_restriction.hpp +++ b/src/common/low_precision_transformations/include/low_precision/common/port_quantization_granularity_restriction.hpp @@ -8,7 +8,6 @@ #include #include -#include #include "low_precision/lpt_visibility.hpp" #include "low_precision/rt_info/quantization_granularity_attribute.hpp" diff --git a/src/common/low_precision_transformations/include/low_precision/common/precisions_restriction.hpp b/src/common/low_precision_transformations/include/low_precision/common/precisions_restriction.hpp index 7dd7e760658..241d1bcb38b 100644 --- a/src/common/low_precision_transformations/include/low_precision/common/precisions_restriction.hpp +++ b/src/common/low_precision_transformations/include/low_precision/common/precisions_restriction.hpp @@ -9,10 +9,8 @@ #include #include -#include - #include -#include +#include "openvino/core/node.hpp" namespace ngraph { namespace pass { diff --git a/src/common/low_precision_transformations/include/low_precision/common/quantization_granularity_restriction.hpp b/src/common/low_precision_transformations/include/low_precision/common/quantization_granularity_restriction.hpp index 43696d05762..1345e8951bb 100644 --- a/src/common/low_precision_transformations/include/low_precision/common/quantization_granularity_restriction.hpp +++ b/src/common/low_precision_transformations/include/low_precision/common/quantization_granularity_restriction.hpp @@ -9,7 +9,6 @@ #include #include -#include #include #include diff --git a/src/common/low_precision_transformations/include/low_precision/convert_subtract_constant.hpp b/src/common/low_precision_transformations/include/low_precision/convert_subtract_constant.hpp index 1124c4865d2..f1671a545ea 100644 --- a/src/common/low_precision_transformations/include/low_precision/convert_subtract_constant.hpp +++ b/src/common/low_precision_transformations/include/low_precision/convert_subtract_constant.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include "openvino/pass/graph_rewrite.hpp" namespace ngraph { namespace pass { @@ -29,7 +29,7 @@ class LP_TRANSFORMATIONS_API ConvertSubtractConstant; * [ConvertSubtractConstant](@ref openvino_docs_OV_UG_lpt_ConvertSubtractConstant) page * in the Inference Engine Developer Guide. */ -class ngraph::pass::low_precision::ConvertSubtractConstant : public ngraph::pass::MatcherPass { +class ngraph::pass::low_precision::ConvertSubtractConstant : public ov::pass::MatcherPass { public: OPENVINO_RTTI("ConvertSubtractConstant", "0"); ConvertSubtractConstant(const std::vector& constantPrecisions = {}); diff --git a/src/common/low_precision_transformations/include/low_precision/convolution.hpp b/src/common/low_precision_transformations/include/low_precision/convolution.hpp index 0d1fcb3887d..bd093b065f6 100644 --- a/src/common/low_precision_transformations/include/low_precision/convolution.hpp +++ b/src/common/low_precision_transformations/include/low_precision/convolution.hpp @@ -4,7 +4,6 @@ #pragma once -#include #include "weightable_layer_transformation.hpp" namespace ngraph { @@ -23,7 +22,7 @@ class LP_TRANSFORMATIONS_API ConvolutionTransformation : public WeightableLayerT public: OPENVINO_RTTI("ConvolutionTransformation", "0"); ConvolutionTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isQuantized(const std::shared_ptr& layer, const std::vector&defaultPrecisions) const override; static bool isQuantizedStatic(const std::shared_ptr& layer, diff --git a/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp b/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp index 823d5ace1a4..39b15f46761 100644 --- a/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp +++ b/src/common/low_precision_transformations/include/low_precision/convolution_backprop_data.hpp @@ -4,7 +4,6 @@ #pragma once -#include #include "weightable_layer_transformation.hpp" namespace ngraph { @@ -22,7 +21,7 @@ namespace low_precision { class LP_TRANSFORMATIONS_API ConvolutionBackpropDataTransformation : public WeightableLayerTransformation { public: ConvolutionBackpropDataTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; bool isQuantized(const std::shared_ptr& layer, const std::vector&defaultPrecisions) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp b/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp index d9f16d3d186..5fe23505553 100644 --- a/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp +++ b/src/common/low_precision_transformations/include/low_precision/depth_to_space.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API DepthToSpaceTransformation : public TransparentBase public: OPENVINO_RTTI("DepthToSpaceTransformation", "0"); DepthToSpaceTransformation(const Params& params = Params()); - bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; + bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; }; } // namespace low_precision diff --git a/src/common/low_precision_transformations/include/low_precision/fake_quantize.hpp b/src/common/low_precision_transformations/include/low_precision/fake_quantize.hpp index 4d5f5d577cf..b1cf4695d58 100644 --- a/src/common/low_precision_transformations/include/low_precision/fake_quantize.hpp +++ b/src/common/low_precision_transformations/include/low_precision/fake_quantize.hpp @@ -5,7 +5,6 @@ #pragma once #include -#include #include "layer_transformation.hpp" namespace ngraph { @@ -24,15 +23,15 @@ class LP_TRANSFORMATIONS_API FakeQuantizeTransformation : public LayerTransforma public: OPENVINO_RTTI("FakeQuantizeTransformation", "0"); FakeQuantizeTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; static bool checkElementwise(const std::shared_ptr& eltwise); - static std::shared_ptr fuseElementwise( + static std::shared_ptr fuseElementwise( TransformationContext& context, MatcherPass* matcherPass, - const std::shared_ptr& fakeQuantize, + const std::shared_ptr& fakeQuantize, const bool updatePrecisions); }; diff --git a/src/common/low_precision_transformations/include/low_precision/gather.hpp b/src/common/low_precision_transformations/include/low_precision/gather.hpp index a5158dccbf2..60e760e9eb6 100644 --- a/src/common/low_precision_transformations/include/low_precision/gather.hpp +++ b/src/common/low_precision_transformations/include/low_precision/gather.hpp @@ -15,7 +15,7 @@ class LP_TRANSFORMATIONS_API GatherTransformation : public LayerTransformation { public: OPENVINO_RTTI("GatherTransformation", "0"); GatherTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp index 9f19e9d3704..0b600536634 100644 --- a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp @@ -11,9 +11,7 @@ #include #include -#include -#include - +#include "openvino/pass/graph_rewrite.hpp" #include "transformation_context.hpp" #include "quantization_details.hpp" #include "low_precision/common/ie_lpt_exception.hpp" @@ -234,7 +232,7 @@ inline std::ostream &operator << (std::ostream &os, const DataPrecision& value) * @ingroup ie_transformation_common_api * @brief Base class for low precision transformation. */ -class LP_TRANSFORMATIONS_API LayerTransformation : public ngraph::pass::MatcherPass { +class LP_TRANSFORMATIONS_API LayerTransformation : public ov::pass::MatcherPass { public: class Params { public: @@ -285,7 +283,7 @@ public: LayerTransformation(const Params& params); virtual ~LayerTransformation() = default; - virtual bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) = 0; + virtual bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) = 0; void setContext(TransformationContext* context) noexcept; @@ -369,19 +367,19 @@ protected: std::shared_ptr lastNode, std::string originalName) const; - void addPattern(ngraph::pass::GraphRewrite& pass, TransformationContext& context, std::shared_ptr patternRoot); + void addPattern(ov::pass::GraphRewrite& pass, TransformationContext& context, std::shared_ptr patternRoot); //TODO: replace with canBeTransformed when quantization by special dimension is supported for all transformations bool canBeTransformedSpatialDimension(const TransformationContext& context, std::shared_ptr layer) const; template - void addSingleNodePattern(ngraph::pass::GraphRewrite& pass, TransformationContext& context) const { + void addSingleNodePattern(ov::pass::GraphRewrite& pass, TransformationContext& context) const { using namespace ngraph; auto is_op_type = [](std::shared_ptr n) { return !!as_type_ptr(n); }; - auto p_node = std::make_shared(element::f32, Shape{}, is_op_type); + auto p_node = std::make_shared(element::f32, Shape{}, is_op_type); addPattern(pass, context, p_node); } diff --git a/src/common/low_precision_transformations/include/low_precision/low_precision.hpp b/src/common/low_precision_transformations/include/low_precision/low_precision.hpp index ec069ae85d6..9d5777f586f 100644 --- a/src/common/low_precision_transformations/include/low_precision/low_precision.hpp +++ b/src/common/low_precision_transformations/include/low_precision/low_precision.hpp @@ -20,11 +20,12 @@ #include -#include #include #include #include "low_precision/layer_transformation.hpp" #include "low_precision/markup_precisions.hpp" +#include "openvino/pass/graph_rewrite.hpp" +#include "openvino/pass/pass.hpp" namespace ngraph { namespace pass { @@ -38,27 +39,27 @@ class LP_TRANSFORMATIONS_API LowPrecision; } // namespace pass } // namespace ngraph -class ngraph::pass::low_precision::MarkupOptimizations : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::MarkupOptimizations : public ov::pass::ModelPass { public: OPENVINO_RTTI("MarkupOptimizations", "0"); MarkupOptimizations( const std::vector& precisionRestrictions, const std::vector& quantizationRestrictions, const AttributeParameters& params); - bool run_on_model(const std::shared_ptr& m) override; + bool run_on_model(const std::shared_ptr& m) override; private: const std::vector& precisionRestrictions; const std::vector& quantizationRestrictions; const AttributeParameters& params; }; -class ngraph::pass::low_precision::TypeRelaxedReplacer : public ngraph::pass::GraphRewrite { +class ngraph::pass::low_precision::TypeRelaxedReplacer : public ov::pass::GraphRewrite { public: OPENVINO_RTTI("TypeRelaxedReplacer", "0"); TypeRelaxedReplacer(); }; -class ngraph::pass::low_precision::LowPrecision : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::LowPrecision : public ov::pass::ModelPass { public: OPENVINO_RTTI("LowPrecision", "0"); LowPrecision( diff --git a/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp b/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp index 757e6c1ec73..e0b54f75e3f 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp @@ -5,9 +5,9 @@ #pragma once #include -#include #include #include "low_precision/layer_transformation.hpp" +#include "openvino/pass/pass.hpp" namespace ngraph { namespace pass { @@ -27,11 +27,11 @@ class LP_TRANSFORMATIONS_API MarkupAvgPoolPrecisionPreserved; * [MarkupAvgPoolPrecisionPreserved](@ref openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved) page * in the Inference Engine Developer Guide. */ -class ngraph::pass::low_precision::MarkupAvgPoolPrecisionPreserved : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::MarkupAvgPoolPrecisionPreserved : public ov::pass::ModelPass { public: OPENVINO_RTTI("MarkupAvgPoolPrecisionPreserved", "0"); - MarkupAvgPoolPrecisionPreserved(const std::vector defaultPrecisions = ngraph::pass::low_precision::precision_set::int8_support); - bool run_on_model(const std::shared_ptr& m) override; + MarkupAvgPoolPrecisionPreserved(const std::vector defaultPrecisions = ngraph::pass::low_precision::precision_set::int8_support); + bool run_on_model(const std::shared_ptr& m) override; private: const std::vector defaultPrecisions; }; diff --git a/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp b/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp index 45f72915813..ebd227d181c 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp @@ -8,9 +8,9 @@ #include #include -#include #include "low_precision/lpt_visibility.hpp" #include "low_precision/common/precisions_restriction.hpp" +#include "openvino/pass/pass.hpp" namespace ngraph { namespace pass { @@ -34,7 +34,7 @@ class LP_TRANSFORMATIONS_API MarkupPrecisions; * [MarkupPrecisions](@ref openvino_docs_OV_UG_lpt_MarkupPrecisions) page * in the Inference Engine Developer Guide. */ -class ngraph::pass::low_precision::MarkupPrecisions : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::MarkupPrecisions : public ov::pass::ModelPass { public: class Restriction { public: @@ -68,7 +68,7 @@ public: OPENVINO_RTTI("MarkupPrecisions", "0"); explicit MarkupPrecisions(const std::vector& restrictions = {}, const std::vector& defaultPrecisions = { ngraph::element::u8, ngraph::element::i8 }); - bool run_on_model(const std::shared_ptr& m) override; + bool run_on_model(const std::shared_ptr& m) override; private: static bool isPrecisionPreserved(const std::shared_ptr& node); diff --git a/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp b/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp index 2308c768d72..1d87647582b 100644 --- a/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp +++ b/src/common/low_precision_transformations/include/low_precision/mat_mul.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API MatMulTransformation : public LayerTransformation { public: OPENVINO_RTTI("MatMulTransformation", "0"); MatMulTransformation(const Params& params = Params()); - bool transform(TransformationContext &context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp b/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp index cbb8568aacc..ea951bbb99f 100644 --- a/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp +++ b/src/common/low_precision_transformations/include/low_precision/multiply_to_group_convolution.hpp @@ -5,7 +5,6 @@ #pragma once #include -#include #include "low_precision/layer_transformation.hpp" #include "common/precisions_restriction.hpp" @@ -28,7 +27,7 @@ public: const Params& params = Params(), const PrecisionsRestriction::PrecisionsByPorts& restrictions = {}); ~MultiplyToGroupConvolutionTransformation() override {} - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool isQuantized(const std::shared_ptr& layer, diff --git a/src/common/low_precision_transformations/include/low_precision/mvn.hpp b/src/common/low_precision_transformations/include/low_precision/mvn.hpp index 70658870ea1..88e39b11c76 100644 --- a/src/common/low_precision_transformations/include/low_precision/mvn.hpp +++ b/src/common/low_precision_transformations/include/low_precision/mvn.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API MVNTransformation : public LayerTransformation { public: OPENVINO_RTTI("MVNTransformation", "0"); MVNTransformation(const Params& params = Params()); - bool transform(TransformationContext &context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/network_helper.hpp b/src/common/low_precision_transformations/include/low_precision/network_helper.hpp index 520ed58ca83..687328a5a9d 100644 --- a/src/common/low_precision_transformations/include/low_precision/network_helper.hpp +++ b/src/common/low_precision_transformations/include/low_precision/network_helper.hpp @@ -10,11 +10,7 @@ #include #include -#include -#include -#include #include "ov_ops/type_relaxed.hpp" -#include #include "rt_info/shared_value_attribute.hpp" #include "rt_info/precisions_attribute.hpp" @@ -26,6 +22,7 @@ #include "common/fake_quantize_dequantization.hpp" #include "common/ie_lpt_exception.hpp" #include "layer_transformation.hpp" +#include "openvino/opsets/opset1.hpp" namespace ngraph { namespace pass { @@ -54,8 +51,8 @@ public: static std::shared_ptr setOutDataPrecision(std::shared_ptr operation, const element::Type& precision); // applies constant folding of operation to constant and returns the specified output - static std::shared_ptr foldDequantizationConstant( - const std::shared_ptr& foldingConstant, + static std::shared_ptr foldDequantizationConstant( + const std::shared_ptr& foldingConstant, const std::shared_ptr& operation, const size_t outIdx = 0); @@ -73,7 +70,7 @@ public: // Remove node by connecting its 0th input with 0th output static void removeLayer(std::shared_ptr node); - static std::shared_ptr swapMultiplyAndAdd(std::shared_ptr addAfterMultiply, const int multiplyBranch); + static std::shared_ptr swapMultiplyAndAdd(std::shared_ptr addAfterMultiply, const int multiplyBranch); static void copyInfo(const std::vector>& sources, const std::vector>& targets, bool overrideName = true); @@ -81,11 +78,11 @@ public: static void copyInfo(const std::shared_ptr& source, const std::shared_ptr& target, bool overrideName = true); - static bool isScalarLike(std::shared_ptr constant); + static bool isScalarLike(std::shared_ptr constant); - static bool isZero(std::shared_ptr constant); + static bool isZero(std::shared_ptr constant); - static std::shared_ptr toScalar(std::shared_ptr constant); + static std::shared_ptr toScalar(std::shared_ptr constant); static std::shared_ptr getConstantInput(const std::shared_ptr& node, const bool convertIsExpected = false); @@ -95,15 +92,15 @@ public: const std::vector& reshapeValues); // Optimizes the series of multiplies after a given output port - static std::shared_ptr optimizeMultipliesAfter(std::shared_ptr multiply); + static std::shared_ptr optimizeMultipliesAfter(std::shared_ptr multiply); - static std::shared_ptr round(std::shared_ptr node, element::Type target_type); + static std::shared_ptr round(std::shared_ptr node, element::Type target_type); - static std::shared_ptr composeFakeQuantize(const std::shared_ptr& fq, + static std::shared_ptr composeFakeQuantize(const std::shared_ptr& fq, const std::vector& defaultPrecisions = precision_set::int8_support); static std::tuple, std::shared_ptr> decomposeFakeQuantize( - std::shared_ptr fq, + std::shared_ptr fq, const element::Type precision, const float min, const float max, @@ -112,8 +109,8 @@ public: const element::Type deqPrecision = element::f32, const size_t outChannelsShapeIndex = 0); - static std::shared_ptr updateFakeQuantize( - std::shared_ptr fq, + static std::shared_ptr updateFakeQuantize( + std::shared_ptr fq, element::Type precision, float min, float max, @@ -138,7 +135,7 @@ public: static bool areQuantizeAndDequantizeSupportedForMultiply(const std::shared_ptr& node, const std::vector& _defaultPrecisions = precision_set::int8_support); - static bool isQuantizeSupported(const std::shared_ptr& fakeQuantize); + static bool isQuantizeSupported(const std::shared_ptr& fakeQuantize); static FakeQuantizeDequantization getDequantization(const std::shared_ptr& node, const std::vector _defaultPrecisions = precision_set::int8_support, @@ -149,14 +146,14 @@ public: static FakeQuantizeDequantization normalizeDequantization(FakeQuantizeDequantization dequantization); - static std::shared_ptr normalizeDequantizationShape( + static std::shared_ptr normalizeDequantizationShape( const std::shared_ptr& eltwise, const bool convertIsExpected = true); // 1. remove Convert if possible // 2. optimize Constant if possible // 3. remove Subtract if Constant on the second branch is zero - static std::shared_ptr optimizeSubtract(std::shared_ptr add); + static std::shared_ptr optimizeSubtract(std::shared_ptr add); class InsertDequantizationResult { public: @@ -181,9 +178,9 @@ public: const bool updatePrecision, const bool moveSubtract); - static std::vector>> splitConstantsBeforeConcat( + static std::vector>> splitConstantsBeforeConcat( const std::shared_ptr concat, - const std::vector> currConstants); + const std::vector> currConstants); static bool checkConstantValuePrecision(const element::Type expectedPrecision, const std::shared_ptr& constant); @@ -198,8 +195,8 @@ public: static std::shared_ptr toScalarIfPossible(std::shared_ptr node); - static std::shared_ptr fold_fake_quantize(const std::shared_ptr& fq); - static std::shared_ptr fold_fake_quantize(const std::shared_ptr& fq, const bool roundValues); + static std::shared_ptr fold_fake_quantize(const std::shared_ptr& fq); + static std::shared_ptr fold_fake_quantize(const std::shared_ptr& fq, const bool roundValues); static FakeQuantizeDequantization foldDequantization(const std::shared_ptr& node, const size_t branchIndex, @@ -209,7 +206,7 @@ public: static std::shared_ptr separateInStandaloneBranch(std::shared_ptr node, const std::vector& defaultPrecisions = precision_set::int8_support); - static std::shared_ptr fuseConvert(const std::shared_ptr& fakeQuantize); + static std::shared_ptr fuseConvert(const std::shared_ptr& fakeQuantize); static std::vector precisionIntersection( const std::vector& v1, @@ -254,7 +251,7 @@ public: private: static std::shared_ptr foldFakeQuantize( - const std::shared_ptr& fq, + const std::shared_ptr& fq, const bool roundValues, const bool roundValuesWasSet); @@ -296,7 +293,8 @@ std::shared_ptr NetworkHelper::setOutDataPrecision(std::shared_ptr std::shared_ptr make_op_pattern(const ngraph::NodeVector& args) { - return std::make_shared(element::undefined, PartialShape{}, [](std::shared_ptr n) {return !!ov::as_type_ptr(n); }, args); + return std::make_shared(element::undefined, PartialShape{}, + [](std::shared_ptr n) {return !!ov::as_type_ptr(n); }, args); } template @@ -317,14 +315,14 @@ template std::shared_ptr fold_reshape(Args&&... args) { std::shared_ptr node = std::make_shared(args...); if (node->get_output_size() == 1) { - const auto data_const = ov::as_type_ptr(node->get_input_node_shared_ptr(0)); - const auto target_shape = ov::as_type_ptr(node->get_input_node_shared_ptr(1)); + const auto data_const = ov::as_type_ptr(node->get_input_node_shared_ptr(0)); + const auto target_shape = ov::as_type_ptr(node->get_input_node_shared_ptr(1)); if (data_const && target_shape) { - return std::make_shared(node->get_input_element_type(0), + return std::make_shared(node->get_input_element_type(0), node->get_output_shape(0), data_const->get_data_ptr()); } - return fold(std::forward(args)...); + return fold(std::forward(args)...); } return node; } diff --git a/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp b/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp index e20e8197fb3..4180c1dd265 100644 --- a/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp +++ b/src/common/low_precision_transformations/include/low_precision/normalize_l2.hpp @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API NormalizeL2Transformation : public LayerTransformat public: OPENVINO_RTTI("NormalizeL2Transformation", "0"); NormalizeL2Transformation(const Params& params = Params()); - bool transform(TransformationContext &context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext &context, ov::pass::pattern::Matcher &m) override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; }; diff --git a/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp b/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp index 3d3c562c8aa..0b7016dbc57 100644 --- a/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp +++ b/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp @@ -7,10 +7,9 @@ #include #include -#include -#include #include #include "low_precision/rt_info/attribute_parameters.hpp" +#include "openvino/pass/pass.hpp" namespace ngraph { namespace pass { @@ -30,11 +29,11 @@ class LP_TRANSFORMATIONS_API PropagatePrecisions; * [PropagatePrecisions](@ref openvino_docs_OV_UG_lpt_PropagatePrecisions) page * in the Inference Engine Developer Guide. */ -class ngraph::pass::low_precision::PropagatePrecisions : public ngraph::pass::FunctionPass { +class ngraph::pass::low_precision::PropagatePrecisions : public ov::pass::ModelPass { public: OPENVINO_RTTI("PropagatePrecisions", "0"); PropagatePrecisions(const AttributeParameters& params = AttributeParameters()); - bool run_on_model(const std::shared_ptr& m) override; + bool run_on_model(const std::shared_ptr& m) override; private: const AttributeParameters params; diff --git a/src/common/low_precision_transformations/include/low_precision/propagate_through_precision_preserved.hpp b/src/common/low_precision_transformations/include/low_precision/propagate_through_precision_preserved.hpp index c1e3d7584db..f30ba75eb6e 100644 --- a/src/common/low_precision_transformations/include/low_precision/propagate_through_precision_preserved.hpp +++ b/src/common/low_precision_transformations/include/low_precision/propagate_through_precision_preserved.hpp @@ -104,9 +104,9 @@ private: auto getInput = [&defaultPrecisions](const std::shared_ptr& node, const size_t index) -> Input { const auto dequantization = NetworkHelper::getDequantization(node, defaultPrecisions, index); if (!dequantization.empty() && - ov::is_type(dequantization.data.get_node()) && + ov::is_type(dequantization.data.get_node()) && (dequantization.data.get_node()->get_input_size() == 1ul) && - ov::is_type(dequantization.data.get_node()->get_input_node_ptr(0))) { + ov::is_type(dequantization.data.get_node()->get_input_node_ptr(0))) { return dequantization.data.get_node()->input(0); } diff --git a/src/common/low_precision_transformations/include/low_precision/quantization_details.hpp b/src/common/low_precision_transformations/include/low_precision/quantization_details.hpp index fe1788bb600..49cf84c7443 100644 --- a/src/common/low_precision_transformations/include/low_precision/quantization_details.hpp +++ b/src/common/low_precision_transformations/include/low_precision/quantization_details.hpp @@ -9,10 +9,7 @@ #include #include - -#include -#include -#include +#include "openvino/opsets/opset1.hpp" namespace ngraph { namespace pass { @@ -29,19 +26,19 @@ public: const std::vector& outputLowValues, const std::vector& outputHighValues); - static bool outputLayoutIsSupported(std::shared_ptr quantize, bool isConvertExpected = false); + static bool outputLayoutIsSupported(std::shared_ptr quantize, bool isConvertExpected = false); static void getInputIntervals( - std::shared_ptr quantize, + std::shared_ptr quantize, std::vector& inputLowValues, std::vector& inputHighValues); static void getOutputIntervals( - std::shared_ptr quantize, + std::shared_ptr quantize, std::vector& outputLowValues, std::vector& outputHighValues); - static QuantizationDetails getDetails(std::shared_ptr); + static QuantizationDetails getDetails(std::shared_ptr); bool hasNegativeOutput() const; float maxOutput(const size_t channel) const; float maxInput(const size_t channel) const; diff --git a/src/common/low_precision_transformations/include/low_precision/reshape.hpp b/src/common/low_precision_transformations/include/low_precision/reshape.hpp index d68bff5650e..ce1fe3050e0 100644 --- a/src/common/low_precision_transformations/include/low_precision/reshape.hpp +++ b/src/common/low_precision_transformations/include/low_precision/reshape.hpp @@ -23,7 +23,7 @@ class LP_TRANSFORMATIONS_API ReshapeTransformation : public LayerTransformation public: OPENVINO_RTTI("ReshapeTransformation", "0"); ReshapeTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher &m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher &m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr op) const override; diff --git a/src/common/low_precision_transformations/include/low_precision/rt_info/precisions_attribute.hpp b/src/common/low_precision_transformations/include/low_precision/rt_info/precisions_attribute.hpp index 0a69000b85e..55b887d68d4 100644 --- a/src/common/low_precision_transformations/include/low_precision/rt_info/precisions_attribute.hpp +++ b/src/common/low_precision_transformations/include/low_precision/rt_info/precisions_attribute.hpp @@ -9,9 +9,6 @@ #include #include -#include -#include - #include "low_precision/lpt_visibility.hpp" #include "low_precision/rt_info/attribute_parameters.hpp" #include "low_precision/rt_info/shared_value_attribute.hpp" diff --git a/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_alignment_attribute.hpp b/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_alignment_attribute.hpp index 30daa5f8073..375c1ce1e1d 100644 --- a/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_alignment_attribute.hpp +++ b/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_alignment_attribute.hpp @@ -9,10 +9,7 @@ #include #include -#include - #include -#include #include "shared_value_attribute.hpp" #include "attribute_parameters.hpp" diff --git a/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_granularity_attribute.hpp b/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_granularity_attribute.hpp index df466ef041c..053edb4fda2 100644 --- a/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_granularity_attribute.hpp +++ b/src/common/low_precision_transformations/include/low_precision/rt_info/quantization_granularity_attribute.hpp @@ -4,10 +4,7 @@ #pragma once -#include - #include -#include #include "low_precision/rt_info/shared_value_attribute.hpp" #include "low_precision/layer_transformation.hpp" #include "attribute_parameters.hpp" diff --git a/src/common/low_precision_transformations/include/low_precision/rt_info/shared_value_attribute.hpp b/src/common/low_precision_transformations/include/low_precision/rt_info/shared_value_attribute.hpp index 02a0316a51f..0f120b46d4b 100644 --- a/src/common/low_precision_transformations/include/low_precision/rt_info/shared_value_attribute.hpp +++ b/src/common/low_precision_transformations/include/low_precision/rt_info/shared_value_attribute.hpp @@ -11,7 +11,6 @@ #include #include -#include template class LP_TRANSFORMATIONS_API SharedAttribute : public ov::RuntimeAttribute { diff --git a/src/common/low_precision_transformations/include/low_precision/split.hpp b/src/common/low_precision_transformations/include/low_precision/split.hpp index 28368cab0f0..575101299fb 100644 --- a/src/common/low_precision_transformations/include/low_precision/split.hpp +++ b/src/common/low_precision_transformations/include/low_precision/split.hpp @@ -25,7 +25,7 @@ class LP_TRANSFORMATIONS_API SplitTransformation : public LayerTransformation { public: OPENVINO_RTTI("SplitTransformation", "0"); SplitTransformation(const Params& params = Params()); - bool transform(TransformationContext& context, ngraph::pattern::Matcher& m) override; + bool transform(TransformationContext& context, ov::pass::pattern::Matcher& m) override; bool isPrecisionPreserved(std::shared_ptr layer) const noexcept override; bool canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const override; void updateOutputs( diff --git a/src/common/low_precision_transformations/include/low_precision/transformation_context.hpp b/src/common/low_precision_transformations/include/low_precision/transformation_context.hpp index 8c058c02930..26ee65cc075 100644 --- a/src/common/low_precision_transformations/include/low_precision/transformation_context.hpp +++ b/src/common/low_precision_transformations/include/low_precision/transformation_context.hpp @@ -6,7 +6,6 @@ #include #include -#include #include "low_precision/quantization_details.hpp" namespace ngraph { diff --git a/src/common/low_precision_transformations/include/low_precision/update_shared_precision_preserved.hpp b/src/common/low_precision_transformations/include/low_precision/update_shared_precision_preserved.hpp index 9f752af5aa0..99f6ee0d583 100644 --- a/src/common/low_precision_transformations/include/low_precision/update_shared_precision_preserved.hpp +++ b/src/common/low_precision_transformations/include/low_precision/update_shared_precision_preserved.hpp @@ -34,23 +34,23 @@ class UpdateSharedPrecisionPreserved; * in the Inference Engine Developer Guide. */ template -class ngraph::pass::low_precision::UpdateSharedPrecisionPreserved : public ngraph::pass::MatcherPass { +class ngraph::pass::low_precision::UpdateSharedPrecisionPreserved : public ov::pass::MatcherPass { public: UpdateSharedPrecisionPreserved(const std::vector& defaultPrecisions = precision_set::int8_support) { - ngraph::graph_rewrite_callback callback = [&](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [&](ov::pass::pattern::Matcher& m) { auto node = m.get_match_root(); const bool needToCheckExpectedAttributeType = !std::is_same::value; if (!needToCheckExpectedAttributeType) { // expected attribute is ignored, set attributes for node inputs except Result & FakeQuantize operations - if (ov::is_type(node) || - ov::is_type(node) || + if (ov::is_type(node) || + ov::is_type(node) || transformation_callback(node)) { return false; } } - if (ngraph::pass::low_precision::NetworkHelper::isPrecisionPreserved(node) || ov::is_type(node)) { + if (ngraph::pass::low_precision::NetworkHelper::isPrecisionPreserved(node) || ov::is_type(node)) { return false; } @@ -90,7 +90,7 @@ public: return true; }; - auto matcher = std::make_shared(pattern::any_input(), "UpdateSharedPrecisionPreserved"); + auto matcher = std::make_shared(ov::pass::pattern::any_input(), "UpdateSharedPrecisionPreserved"); this->register_matcher(matcher, callback); } @@ -98,8 +98,8 @@ private: Input getDequantizationInput(const Input& input, const std::vector& defaultPrecisions) { const auto dequantization = NetworkHelper::getDequantization(input.get_node()->shared_from_this(), defaultPrecisions, input.get_index()); if (!dequantization.empty() && - (ov::is_type(dequantization.data.get_node())) && - ov::is_type(dequantization.data.get_node()->get_input_node_ptr(0))) { + (ov::is_type(dequantization.data.get_node())) && + ov::is_type(dequantization.data.get_node()->get_input_node_ptr(0))) { assert(dequantization.data.get_target_inputs().size() == 1ul); return *dequantization.data.get_target_inputs().begin(); } diff --git a/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp index 9554a11ca95..09e0f552b54 100644 --- a/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/weightable_layer_transformation.hpp @@ -5,9 +5,9 @@ #pragma once #include -#include #include "transformation_context.hpp" #include "layer_transformation.hpp" +#include "openvino/opsets/opset1.hpp" namespace ngraph { namespace pass { @@ -42,7 +42,7 @@ protected: virtual size_t getInputChannels(const std::shared_ptr conv) const = 0; public: - static std::shared_ptr getFakeQuantizeOnWeights(const std::shared_ptr& node); + static std::shared_ptr getFakeQuantizeOnWeights(const std::shared_ptr& node); static DataPrecision getDataPrecisionOnWeights(const std::shared_ptr& node, const std::vector& defaultPrecisions); static bool isAsymmetricOnWeights(const std::shared_ptr& node, const std::vector& defaultPrecisions = precision_set::int8_support); diff --git a/src/common/low_precision_transformations/src/add.cpp b/src/common/low_precision_transformations/src/add.cpp index 32dcac99b80..2acabdbab85 100644 --- a/src/common/low_precision_transformations/src/add.cpp +++ b/src/common/low_precision_transformations/src/add.cpp @@ -24,29 +24,29 @@ namespace low_precision { namespace { -std::shared_ptr replaceToSubtract(const std::shared_ptr& op) { +std::shared_ptr replaceToSubtract(const std::shared_ptr& op) { // TODO: separate this part to standalone transformation: AddToSubtractTransformation // motivation: // - single responsibility // - keep AddTransformation and AddToSubtractTransformation transformations independent and optional - const auto add = ov::as_type_ptr(op); + const auto add = ov::as_type_ptr(op); if (add == nullptr || ov::marked_as_bias(add)) { return nullptr; } // TODO: use general way from getDequantization: is eltwise with Constant - const int constBranchIndex = ov::is_type(add->get_input_node_ptr(0)) ? + const int constBranchIndex = ov::is_type(add->get_input_node_ptr(0)) ? 0 : - (ov::is_type(add->get_input_node_ptr(1)) ? 1 : -1); + (ov::is_type(add->get_input_node_ptr(1)) ? 1 : -1); if (constBranchIndex == -1) { return nullptr; } const size_t dataBranchIndex = constBranchIndex == 0 ? 1ul : 0; - auto constant = fold(add->input_value(constBranchIndex)); + auto constant = fold(add->input_value(constBranchIndex)); auto constOutput = constant->output(0); - const auto subtract = std::make_shared>( + const auto subtract = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ op->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(add->input_value(dataBranchIndex), element::f32).get(), @@ -59,20 +59,20 @@ std::shared_ptr replaceToSubtract(const std::shared_ptr& return subtract; } -std::shared_ptr fuseWithSubtract(const std::shared_ptr& op) { - const auto add = ov::as_type_ptr(op); +std::shared_ptr fuseWithSubtract(const std::shared_ptr& op) { + const auto add = ov::as_type_ptr(op); if ((add == nullptr) || - !ov::is_type(add->get_input_node_shared_ptr(0)) || + !ov::is_type(add->get_input_node_shared_ptr(0)) || // TODO: use general way from getDequantization: is eltwise with Constant - !ov::is_type(add->get_input_node_shared_ptr(0)->get_input_node_shared_ptr(1))) { + !ov::is_type(add->get_input_node_shared_ptr(0)->get_input_node_shared_ptr(1))) { return nullptr; } - const auto newSubConst = fold( + const auto newSubConst = fold( add->get_input_node_shared_ptr(0)->input_value(1), add->input_value(1)); - const auto newSubtract = std::make_shared>( + const auto newSubtract = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ op->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(add->get_input_node_shared_ptr(0)->input_value(0), element::f32).get(), @@ -87,7 +87,7 @@ std::shared_ptr fuseWithSubtract(const std::shared_ptr& AddTransformation::AddTransformation(const Params& params) : EltwiseBaseTransformation(params) { MATCHER_SCOPE(AddTransformation); - auto matcher = ngraph::pattern::wrap_type(); + auto matcher = ngraph::pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -102,7 +102,7 @@ AddTransformation::AddTransformation(const Params& params) : EltwiseBaseTransfor } bool AddTransformation::transform(TransformationContext& context, ngraph::pattern::Matcher &m) { - std::shared_ptr op = ov::as_type_ptr(m.get_match_root()); + std::shared_ptr op = ov::as_type_ptr(m.get_match_root()); if ((op == nullptr) || (!canBeTransformed(context, op))) { return false; } @@ -111,7 +111,7 @@ bool AddTransformation::transform(TransformationContext& context, ngraph::patter NetworkHelper::normalizeDequantization(NetworkHelper::getDequantization(op, defaultPrecisions, 1)); std::shared_ptr addNode = NetworkHelper::separateInStandaloneBranch(op, defaultPrecisions); - std::shared_ptr add = ov::as_type_ptr(addNode); + std::shared_ptr add = ov::as_type_ptr(addNode); const int fullPathIndex = getNotEmpty(add); std::shared_ptr newMultiply; @@ -131,7 +131,7 @@ bool AddTransformation::transform(TransformationContext& context, ngraph::patter newMultiply = NetworkHelper::swapMultiplyAndAdd(add, multiplyBranch.first); ngraph::copy_runtime_info({ add, newMultiply }, newMultiply); - if (ov::is_type(newMultiply->get_input_node_shared_ptr(0))) { + if (ov::is_type(newMultiply->get_input_node_shared_ptr(0))) { newAddOrSubtract = newMultiply->get_input_node_shared_ptr(0); auto subtract = fuseWithSubtract(newAddOrSubtract); @@ -172,13 +172,13 @@ bool AddTransformation::transform(TransformationContext& context, ngraph::patter // after : Y = SC2 * ( SC1' * (X1 - SH1') + X2 ) , where : // SC1' = SC1 / SC2 // SH1' = SH1 + SC2 * SH2 / SC1 - auto newSubtractFullPathValues = fold( + auto newSubtractFullPathValues = fold( subtractFullPathValues, - fold( - fold(subtractEmptyPathValues, multiplyEmptyPathValues), + fold( + fold(subtractEmptyPathValues, multiplyEmptyPathValues), multiplyFullPathValues)); - auto newMultiplyFullPathValues = fold(multiplyFullPathValues, multiplyEmptyPathValues); + auto newMultiplyFullPathValues = fold(multiplyFullPathValues, multiplyEmptyPathValues); // Transformation can't be applied if new full path values brake accuracy because of Inf values if (!NetworkHelper::checkConstantNotInf(newSubtractFullPathValues) || @@ -202,25 +202,25 @@ bool AddTransformation::transform(TransformationContext& context, ngraph::patter // newMultiply inputs[emptyPathIndex] = dequantizationEmptyPath.data; - inputs[fullPathIndex] = std::make_shared( + inputs[fullPathIndex] = std::make_shared( newSubtractFullPathValues == nullptr ? (fullPathInput.get_element_type() != newMultiplyFullPathValues->get_element_type() ? - std::make_shared(fullPathInput, newMultiplyFullPathValues->get_element_type()) : + std::make_shared(fullPathInput, newMultiplyFullPathValues->get_element_type()) : fullPathInput) : - std::make_shared( + std::make_shared( // precision on branch with dequantization operations can be different with dequantization precision, // for example: FP16 model with FP32 dequantization fullPathInput.get_element_type() != newSubtractFullPathValues->get_element_type() ? - std::make_shared(fullPathInput, newSubtractFullPathValues->get_element_type()) : + std::make_shared(fullPathInput, newSubtractFullPathValues->get_element_type()) : fullPathInput, newSubtractFullPathValues), newMultiplyFullPathValues); - newAddOrSubtract = std::make_shared>( + newAddOrSubtract = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ element::f32 }, ov::op::TemporaryReplaceOutputType(inputs[0], element::f32).get(), ov::op::TemporaryReplaceOutputType(inputs[1], element::f32).get()); - newMultiply = std::make_shared>( + newMultiply = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ add->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(newAddOrSubtract, element::f32).get(), ov::op::TemporaryReplaceOutputType(multiplyEmptyPathValues, element::f32).get()); diff --git a/src/common/low_precision_transformations/src/align_quantization_intervals.cpp b/src/common/low_precision_transformations/src/align_quantization_intervals.cpp index d56a1883379..a9ad45c3c2d 100644 --- a/src/common/low_precision_transformations/src/align_quantization_intervals.cpp +++ b/src/common/low_precision_transformations/src/align_quantization_intervals.cpp @@ -10,6 +10,7 @@ #include "low_precision/rt_info/intervals_alignment_attribute.hpp" #include "low_precision/rt_info/attribute_parameters.hpp" #include "itt.hpp" +#include "openvino/pass/manager.hpp" using namespace ngraph; using namespace ngraph::pass::low_precision; @@ -19,7 +20,7 @@ ngraph::pass::low_precision::AlignQuantizationIntervals::AlignQuantizationInterv bool ngraph::pass::low_precision::AlignQuantizationIntervals::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(AlignQuantizationIntervals); - ngraph::pass::Manager manager; + ov::pass::Manager manager; manager.set_per_pass_validation(false); std::shared_ptr intervalsAlignment = manager.register_pass(); intervalsAlignment->add_matcher>( diff --git a/src/common/low_precision_transformations/src/align_quantization_parameters.cpp b/src/common/low_precision_transformations/src/align_quantization_parameters.cpp index 4ee7557e8de..c2d1eb53ccb 100644 --- a/src/common/low_precision_transformations/src/align_quantization_parameters.cpp +++ b/src/common/low_precision_transformations/src/align_quantization_parameters.cpp @@ -11,6 +11,7 @@ #include "low_precision/rt_info/quantization_granularity_attribute.hpp" #include "low_precision/update_shared_precision_preserved.hpp" #include "itt.hpp" +#include "openvino/pass/manager.hpp" using namespace ngraph; using namespace ngraph::pass::low_precision; @@ -20,7 +21,7 @@ ngraph::pass::low_precision::AlignQuantizationParameters::AlignQuantizationParam bool ngraph::pass::low_precision::AlignQuantizationParameters::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(AlignQuantizationParameters); - ngraph::pass::Manager manager; + ov::pass::Manager manager; manager.set_per_pass_validation(false); std::shared_ptr propagation = manager.register_pass(); propagation->add_matcher>(); diff --git a/src/common/low_precision_transformations/src/assign_and_read_value.cpp b/src/common/low_precision_transformations/src/assign_and_read_value.cpp index 968b831a8e3..46e73b17129 100644 --- a/src/common/low_precision_transformations/src/assign_and_read_value.cpp +++ b/src/common/low_precision_transformations/src/assign_and_read_value.cpp @@ -21,8 +21,8 @@ namespace low_precision { AssignAndReadValueTransformation::AssignAndReadValueTransformation(const std::shared_ptr function, const Params& params) : LayerTransformation(params), function(function) { MATCHER_SCOPE(AssignAndReadValueTransformation); - auto assign3 = pattern::wrap_type({ pattern::wrap_type() }); - auto assign6 = pattern::wrap_type({ pattern::wrap_type() }); + auto assign3 = pattern::wrap_type({ pattern::wrap_type() }); + auto assign6 = pattern::wrap_type({ pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [=](pattern::Matcher& m) { const auto& opsMap = m.get_pattern_value_map(); @@ -86,15 +86,15 @@ bool AssignAndReadValueTransformation::transform(TransformationContext& context, if (nextLayers.size() > 1) { return true; } - const auto fakeQuantize = as_type_ptr(nextLayers.begin()->get_node()->shared_from_this()); + const auto fakeQuantize = as_type_ptr(nextLayers.begin()->get_node()->shared_from_this()); if (fakeQuantize == nullptr) { return true; } auto fakeQuantizeInputs = fakeQuantize->input_values(); - const auto inputLow = as_type_ptr(fakeQuantizeInputs[1].get_node_shared_ptr()); - const auto inputHigh = as_type_ptr(fakeQuantizeInputs[2].get_node_shared_ptr()); + const auto inputLow = as_type_ptr(fakeQuantizeInputs[1].get_node_shared_ptr()); + const auto inputHigh = as_type_ptr(fakeQuantizeInputs[2].get_node_shared_ptr()); if (inputLow == nullptr || inputHigh == nullptr) { return true; diff --git a/src/common/low_precision_transformations/src/clamp.cpp b/src/common/low_precision_transformations/src/clamp.cpp index 040028b05fb..3f27c599d96 100644 --- a/src/common/low_precision_transformations/src/clamp.cpp +++ b/src/common/low_precision_transformations/src/clamp.cpp @@ -17,7 +17,7 @@ namespace low_precision { ClampTransformation::ClampTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(ClampTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -45,9 +45,9 @@ bool ClampTransformation::transform(TransformationContext& context, ngraph::patt return false; } - const auto newClamp = ov::as_type_ptr(moveDequantizationAfter(context, clamp, dequantization, false, moveSubtract)); + const auto newClamp = ov::as_type_ptr(moveDequantizationAfter(context, clamp, dequantization, false, moveSubtract)); - std::shared_ptr replacement; + std::shared_ptr replacement; { double min = newClamp->get_min(); double max = newClamp->get_max(); @@ -67,7 +67,7 @@ bool ClampTransformation::transform(TransformationContext& context, ngraph::patt max += shift; } - replacement = std::make_shared(newClamp->input_value(0), min, max); + replacement = std::make_shared(newClamp->input_value(0), min, max); } replace_node_update_name(newClamp, replacement); diff --git a/src/common/low_precision_transformations/src/convert.cpp b/src/common/low_precision_transformations/src/convert.cpp index ffcbaacded4..b454f868061 100644 --- a/src/common/low_precision_transformations/src/convert.cpp +++ b/src/common/low_precision_transformations/src/convert.cpp @@ -22,7 +22,7 @@ namespace low_precision { ConvertTransformation::ConvertTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(ConvertTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -37,7 +37,7 @@ ConvertTransformation::ConvertTransformation(const Params& params) : LayerTransf } bool ConvertTransformation::transform(TransformationContext& context, ngraph::pattern::Matcher &m) { - std::shared_ptr convert = ov::as_type_ptr(m.get_match_root()); + std::shared_ptr convert = ov::as_type_ptr(m.get_match_root()); if (!convert) { return false; } @@ -48,9 +48,9 @@ bool ConvertTransformation::transform(TransformationContext& context, ngraph::pa const ngraph::element::Type precisionBefore = convert->get_input_element_type(0); - std::shared_ptr subtract = std::make_shared>( + std::shared_ptr subtract = std::make_shared>( convert->input_value(0), - std::make_shared(precisionBefore, Shape{}, std::vector({ 0 }))); + std::make_shared(precisionBefore, Shape{}, std::vector({ 0 }))); NetworkHelper::setOutDataPrecision(subtract, convert->get_output_element_type(0)); replace_node(convert, subtract); diff --git a/src/common/low_precision_transformations/src/convert_subtract_constant.cpp b/src/common/low_precision_transformations/src/convert_subtract_constant.cpp index dcb183847f2..0f82a276e57 100644 --- a/src/common/low_precision_transformations/src/convert_subtract_constant.cpp +++ b/src/common/low_precision_transformations/src/convert_subtract_constant.cpp @@ -44,7 +44,7 @@ ngraph::pass::low_precision::ConvertSubtractConstant::ConvertSubtractConstant(co auto multiplyConstantWrapper = ngraph::pattern::wrap_type(pattern::consumers_count(1)); auto multiplyWrapper = ngraph::pattern::wrap_type({ subtractWrapper, multiplyConstantWrapper }, pattern::consumers_count(1)); - ngraph::matcher_pass_callback callback = [=](ngraph::pattern::Matcher & m) -> bool { + ov::matcher_pass_callback callback = [=](ngraph::pattern::Matcher & m) -> bool { const auto& opsMap = m.get_pattern_value_map(); const auto weightsConvert = opsMap.at(weightsConvertWrapper).get_node_shared_ptr(); const auto quantizePrecision = weightsConvert->get_input_element_type(0); diff --git a/src/common/low_precision_transformations/src/convolution.cpp b/src/common/low_precision_transformations/src/convolution.cpp index 23fd322608b..5fd0abf6075 100644 --- a/src/common/low_precision_transformations/src/convolution.cpp +++ b/src/common/low_precision_transformations/src/convolution.cpp @@ -22,16 +22,16 @@ namespace low_precision { ConvolutionTransformation::ConvolutionTransformation(const Params& params) : WeightableLayerTransformation(params) { MATCHER_SCOPE(ConvolutionTransformation); - auto matcher = ngraph::pattern::wrap_type({ - ngraph::pattern::wrap_type(), + auto matcher = ngraph::pattern::wrap_type({ + ngraph::pattern::wrap_type(), std::make_shared(OutputVector { - pattern::wrap_type(), - pattern::wrap_type() + pattern::wrap_type(), + pattern::wrap_type() }) }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -64,7 +64,7 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph if (!canConvolutionBeTransformed(context, convolution, defaultPrecisions)) { const auto weightInput = convolution->get_input_node_shared_ptr(1); - const auto reshapeFromWeights = ov::as_type_ptr(weightInput); + const auto reshapeFromWeights = ov::as_type_ptr(weightInput); FakeQuantizeDequantization dequantization = reshapeFromWeights == nullptr ? NetworkHelper::getDequantization(convolution, defaultPrecisions, 1ul) : NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions); @@ -72,12 +72,12 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph const auto fqOnWeights = getFakeQuantizeOnWeights(convolution); std::shared_ptr resultConstant = NetworkHelper::fold_fake_quantize(fqOnWeights); if (reshapeFromWeights != nullptr) { - resultConstant = fold_reshape( + resultConstant = fold_reshape( resultConstant, reshapeFromWeights->input_value(1), false); } - if (ov::is_type(resultConstant)) { + if (ov::is_type(resultConstant)) { replace_node(weightInput, resultConstant); } } else { @@ -97,13 +97,13 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph std::shared_ptr newMultiplyAfter; { - std::shared_ptr subtract; + std::shared_ptr subtract; if (dequantization.subtract != nullptr) { auto optimizedSubtract = NetworkHelper::optimizeSubtract(dequantization.subtract); if (optimizedSubtract == nullptr) { optimizedSubtract = dequantization.subtract; } - subtract = ov::as_type_ptr(optimizedSubtract); + subtract = ov::as_type_ptr(optimizedSubtract); } // workaround normalizes shape of Subtract to match CPU plugin expectations @@ -114,14 +114,14 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph Shape broadcastShape(length, 1); broadcastShape[1] = getInputChannels(convolution); - std::shared_ptr newShift = fold( + std::shared_ptr newShift = fold( subtract->input_value(1), - std::make_shared( + std::make_shared( element::i64, Shape{ length }, broadcastShape)); - const auto newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ + const auto newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ subtract->input_value(0), newShift })); NetworkHelper::copyInfo(subtract, newSubtract); @@ -155,35 +155,35 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph Shape newMulShape(outputPShape.size(), 1); newMulShape[1] = outputScales.size(); - newMultiplyAfterConst = std::make_shared( + newMultiplyAfterConst = std::make_shared( dequantization.multiplyConstant->get_element_type(), newMulShape, outputScales); } } else { - newMultiplyAfterConst = std::make_shared( + newMultiplyAfterConst = std::make_shared( dequantization.multiplyConstant->get_element_type(), Shape{ 1 }, dequantization.multiplyConstant->cast_vector()[0]); } const auto copyNode = convolution->clone_with_new_inputs({ dequantization.multiply->input_value(0), convolution->input_value(1) }); - auto conv = ov::as_type_ptr(copyNode); + auto conv = ov::as_type_ptr(copyNode); std::shared_ptr relaxedNewConvolution; if (conv) { - relaxedNewConvolution = std::make_shared>( + relaxedNewConvolution = std::make_shared>( *conv, std::vector{deqPrecision, deqPrecision}, std::vector{deqPrecision}); } else { - relaxedNewConvolution = std::make_shared>( - *ov::as_type_ptr(copyNode), + relaxedNewConvolution = std::make_shared>( + *ov::as_type_ptr(copyNode), std::vector{deqPrecision, deqPrecision}, std::vector{deqPrecision}); } NetworkHelper::copyInfo(convolution, relaxedNewConvolution); - newMultiplyAfter = std::make_shared>( + newMultiplyAfter = std::make_shared>( std::vector{ deqPrecision, deqPrecision }, std::vector{ dequantization.multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(relaxedNewConvolution, deqPrecision).get(), @@ -192,7 +192,7 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph NetworkHelper::insertDequantizationAfter(convolution, newMultiplyAfter, relaxedNewConvolution); convolution = newMultiplyAfter->input_value(0).get_node_shared_ptr(); - if (ov::is_type(convolution->get_input_node_ptr(0))) { + if (ov::is_type(convolution->get_input_node_ptr(0))) { auto newConvolution = convolution->clone_with_new_inputs({ convolution->get_input_node_ptr(0)->input_value(0), convolution->input_value(1)}); @@ -208,27 +208,27 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph return false; } - std::shared_ptr reshapeFromWeights = ov::as_type_ptr(convolution->get_input_node_shared_ptr(1)); + std::shared_ptr reshapeFromWeights = ov::as_type_ptr(convolution->get_input_node_shared_ptr(1)); dequantization = reshapeFromWeights == nullptr ? NetworkHelper::getDequantization(convolution, defaultPrecisions, 1ul) : NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions); assert(!dequantization.empty()); - if (const auto fq = ov::as_type_ptr(dequantization.data.get_node_shared_ptr())) { + if (const auto fq = ov::as_type_ptr(dequantization.data.get_node_shared_ptr())) { const auto newFQ = NetworkHelper::fold_fake_quantize(fq, true); NetworkHelper::copyInfo(fq, newFQ); replace_node(fq, newFQ); } - std::shared_ptr multiplyFromWeights = ov::as_type_ptr( + std::shared_ptr multiplyFromWeights = ov::as_type_ptr( reshapeFromWeights == nullptr ? convolution->get_input_node_shared_ptr(1) : convolution->get_input_node_ptr(1)->get_input_node_shared_ptr(0)); - std::shared_ptr subtractFromWeights = ov::as_type_ptr(multiplyFromWeights->get_input_node_shared_ptr(0)); + std::shared_ptr subtractFromWeights = ov::as_type_ptr(multiplyFromWeights->get_input_node_shared_ptr(0)); { if (reshapeFromWeights != nullptr) { - reshapeFromWeights = ov::as_type_ptr(reshapeFromWeights->clone_with_new_inputs({ + reshapeFromWeights = ov::as_type_ptr(reshapeFromWeights->clone_with_new_inputs({ multiplyFromWeights->input_value(0), reshapeFromWeights->input_value(1) })); } @@ -251,12 +251,12 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph return new_shape; }(); - newMultiplyAfter = std::make_shared( + newMultiplyAfter = std::make_shared( newConvolution, foldConvert( - fold_reshape( + fold_reshape( multiplyFromWeights->input_value(1), - std::make_shared(element::i32, Shape{ newScaleShape.size() }, newScaleShape), + std::make_shared(element::i32, Shape{ newScaleShape.size() }, newScaleShape), false), convolution->get_output_element_type(0))); NetworkHelper::insertDequantizationAfter(convolution, newMultiplyAfter, newConvolution); @@ -271,7 +271,7 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph if (optimizedSubtract == nullptr) { subtractFromWeights = nullptr; } else { - subtractFromWeights = ov::as_type_ptr(optimizedSubtract); + subtractFromWeights = ov::as_type_ptr(optimizedSubtract); const auto weightsPShape = subtractFromWeights->get_input_partial_shape(0); assert(weightsPShape.is_static()); @@ -285,15 +285,15 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph zeroPointShape[1] = static_cast(weightsPShape[1].get_length()); } - auto zeroPointConstant = fold( + auto zeroPointConstant = fold( subtractFromWeights->input_value(1), - std::make_shared(element::i32, Shape{ zeroPointShape.size() }, zeroPointShape)); + std::make_shared(element::i32, Shape{ zeroPointShape.size() }, zeroPointShape)); NetworkHelper::copyInfo(subtractFromWeights->get_input_node_shared_ptr(1), zeroPointConstant); replace_node(subtractFromWeights->get_input_node_shared_ptr(1), zeroPointConstant); } } - std::shared_ptr convertFromWeights = ov::as_type_ptr(subtractFromWeights == nullptr ? + std::shared_ptr convertFromWeights = ov::as_type_ptr(subtractFromWeights == nullptr ? multiplyFromWeights->get_input_node_shared_ptr(0) : subtractFromWeights->get_input_node_shared_ptr(0)); if (convertFromWeights != nullptr) { @@ -310,10 +310,10 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph convolution = newConvolution; } - reshapeFromWeights = ov::as_type_ptr(convolution->get_input_node_shared_ptr(1)); + reshapeFromWeights = ov::as_type_ptr(convolution->get_input_node_shared_ptr(1)); if (reshapeFromWeights != nullptr) { // remove Reshape on weights - const std::shared_ptr newWeights = fold_reshape( + const std::shared_ptr newWeights = fold_reshape( reshapeFromWeights->input_value(0), reshapeFromWeights->input_value(1), false); @@ -323,15 +323,15 @@ bool ConvolutionTransformation::transform(TransformationContext &context, ngraph } const auto finalDequantization = NetworkHelper::optimizeMultipliesAfter(newMultiplyAfter); - ngraph::copy_runtime_info({ convolution, finalDequantization }, finalDequantization); + ov::copy_runtime_info({ convolution, finalDequantization }, finalDequantization); updateOutput(context, finalDequantization, convolution); auto onWeights = convolution->get_input_node_shared_ptr(1); - if (ov::is_type(onWeights)) { + if (ov::is_type(onWeights)) { onWeights = onWeights->get_input_node_shared_ptr(0); } - if (ov::is_type(onWeights)) { + if (ov::is_type(onWeights)) { ov::disable_constant_folding(onWeights); } return true; diff --git a/src/common/low_precision_transformations/src/convolution_backprop_data.cpp b/src/common/low_precision_transformations/src/convolution_backprop_data.cpp index 48972702e4f..62d8f3c3179 100644 --- a/src/common/low_precision_transformations/src/convolution_backprop_data.cpp +++ b/src/common/low_precision_transformations/src/convolution_backprop_data.cpp @@ -23,27 +23,27 @@ namespace low_precision { ConvolutionBackpropDataTransformation::ConvolutionBackpropDataTransformation(const Params& params) : WeightableLayerTransformation(params) { MATCHER_SCOPE(ConvolutionBackpropDataTransformation); auto matcher = std::make_shared(OutputVector{ - pattern::wrap_type({ - pattern::wrap_type(), - pattern::wrap_type() + pattern::wrap_type({ + pattern::wrap_type(), + pattern::wrap_type() }), - ngraph::pattern::wrap_type({ - pattern::wrap_type(), - pattern::wrap_type() + ngraph::pattern::wrap_type({ + pattern::wrap_type(), + pattern::wrap_type() }), - ngraph::pattern::wrap_type({ - pattern::wrap_type(), - pattern::wrap_type(), - pattern::wrap_type() + ngraph::pattern::wrap_type({ + pattern::wrap_type(), + pattern::wrap_type(), + pattern::wrap_type() }), - ngraph::pattern::wrap_type({ - pattern::wrap_type(), - pattern::wrap_type(), - pattern::wrap_type() + ngraph::pattern::wrap_type({ + pattern::wrap_type(), + pattern::wrap_type(), + pattern::wrap_type() }), }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -76,7 +76,7 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con if (!canBeTransformed(context, convolutionBackpropData)) { auto weightsInput = convolutionBackpropData->get_input_node_shared_ptr(1); - std::shared_ptr reshapeFromWeights = ov::as_type_ptr(weightsInput); + std::shared_ptr reshapeFromWeights = ov::as_type_ptr(weightsInput); FakeQuantizeDequantization dequantization = reshapeFromWeights == nullptr ? NetworkHelper::getDequantization(convolutionBackpropData, defaultPrecisions, 1ul) : NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions); @@ -89,12 +89,12 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con auto resultConstant = NetworkHelper::fold_fake_quantize(fqOnWeights, false); if (reshapeFromWeights != nullptr) { - resultConstant = fold_reshape( + resultConstant = fold_reshape( resultConstant, reshapeFromWeights->input_value(1), false); } - if (ov::is_type(resultConstant)) { + if (ov::is_type(resultConstant)) { replace_node(weightsInput, resultConstant); } } else { @@ -111,7 +111,7 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con NetworkHelper::optimizeSubtract(dequantization.subtract); } - std::shared_ptr newMultiplyAfterConst = std::make_shared( + std::shared_ptr newMultiplyAfterConst = std::make_shared( dequantization.multiplyConstant->get_element_type(), Shape{ 1 }, dequantization.multiplyConstant->cast_vector()[0]); @@ -119,12 +119,12 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con inputs[0] = dequantization.multiply->input_value(0); const auto copyNode = convolutionBackpropData->clone_with_new_inputs(inputs); - const auto relaxedConvolutionBackpropData = std::make_shared>( - *ov::as_type_ptr(copyNode), + const auto relaxedConvolutionBackpropData = std::make_shared>( + *ov::as_type_ptr(copyNode), std::vector{deqPrecision, deqPrecision}, std::vector{deqPrecision}); - newMultiplyAfter = std::make_shared>( + newMultiplyAfter = std::make_shared>( std::vector{ deqPrecision, deqPrecision }, std::vector{ dequantization.multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(relaxedConvolutionBackpropData, deqPrecision).get(), @@ -133,7 +133,7 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con convolutionBackpropData = newMultiplyAfter->get_input_node_shared_ptr(0); inputs[0] = convolutionBackpropData->get_input_node_ptr(0)->input_value(0); - if (ov::is_type(convolutionBackpropData->get_input_node_ptr(0))) { + if (ov::is_type(convolutionBackpropData->get_input_node_ptr(0))) { auto newConvolution = convolutionBackpropData->clone_with_new_inputs(inputs); replace_node(convolutionBackpropData, newConvolution); convolutionBackpropData = newConvolution; @@ -144,14 +144,14 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con decomposeFakeQuantizeForWeightsPath(convolutionBackpropData, 1ul); dequantization = NetworkHelper::getDequantization(convolutionBackpropData, defaultPrecisions, 1ul); - if (const auto fq = ov::as_type_ptr(dequantization.data.get_node_shared_ptr())) { + if (const auto fq = ov::as_type_ptr(dequantization.data.get_node_shared_ptr())) { const auto newFQ = NetworkHelper::fold_fake_quantize(fq, true); NetworkHelper::copyInfo(fq, newFQ); replace_node(fq, newFQ); } const auto multiplyFromWeights = convolutionBackpropData->get_input_node_shared_ptr(1); - auto subtractFromWeights = ov::as_type_ptr(multiplyFromWeights->get_input_node_shared_ptr(0)); + auto subtractFromWeights = ov::as_type_ptr(multiplyFromWeights->get_input_node_shared_ptr(0)); { const auto newScalePShape = multiplyFromWeights->get_input_partial_shape(1); @@ -162,12 +162,12 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con inputs[1] = multiplyFromWeights->input_value(0); const auto newconvolutionBackpropData = convolutionBackpropData->copy_with_new_inputs(inputs); - newMultiplyAfter = std::make_shared( + newMultiplyAfter = std::make_shared( newconvolutionBackpropData, foldConvert( - fold_reshape( + fold_reshape( multiplyFromWeights->input_value(1), - std::make_shared(element::u64, Shape{ newScaleShape.size() }, newScaleShape), + std::make_shared(element::u64, Shape{ newScaleShape.size() }, newScaleShape), false), convolutionBackpropData->get_output_element_type(0))); NetworkHelper::insertDequantizationAfter(convolutionBackpropData, newMultiplyAfter, newconvolutionBackpropData); @@ -180,7 +180,7 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con if (optimizedSubtract == nullptr) { subtractFromWeights = nullptr; } else { - subtractFromWeights = ov::as_type_ptr(optimizedSubtract); + subtractFromWeights = ov::as_type_ptr(optimizedSubtract); const auto weightsPShape = subtractFromWeights->get_input_partial_shape(0); assert(weightsPShape.is_static()); @@ -189,15 +189,15 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con Shape zeroPointShape(weightsRankValue, 1ul); zeroPointShape[1] = static_cast(weightsPShape[1].get_length()); - auto zeroPointConstant = fold( + auto zeroPointConstant = fold( subtractFromWeights->input_value(1), - std::make_shared(element::i32, Shape{zeroPointShape.size()}, zeroPointShape)); + std::make_shared(element::i32, Shape{zeroPointShape.size()}, zeroPointShape)); replace_node(subtractFromWeights->get_input_node_shared_ptr(1), zeroPointConstant); } } - std::shared_ptr convertFromWeights = - ov::as_type_ptr( + std::shared_ptr convertFromWeights = + ov::as_type_ptr( subtractFromWeights == nullptr ? multiplyFromWeights->get_input_node_shared_ptr(0) : subtractFromWeights->get_input_node_shared_ptr(0)); @@ -212,15 +212,15 @@ bool ConvolutionBackpropDataTransformation::transform(TransformationContext &con } const auto finalDequantization = NetworkHelper::optimizeMultipliesAfter(newMultiplyAfter); - ngraph::copy_runtime_info({ convolutionBackpropData, finalDequantization }, finalDequantization); + ov::copy_runtime_info({ convolutionBackpropData, finalDequantization }, finalDequantization); updateOutput(context, finalDequantization, convolutionBackpropData); auto onWeights = convolutionBackpropData->get_input_node_shared_ptr(1); - if (ov::is_type(onWeights)) { + if (ov::is_type(onWeights)) { onWeights = onWeights->get_input_node_shared_ptr(0); } - if (ov::is_type(onWeights)) { + if (ov::is_type(onWeights)) { ov::disable_constant_folding(onWeights); } diff --git a/src/common/low_precision_transformations/src/depth_to_space.cpp b/src/common/low_precision_transformations/src/depth_to_space.cpp index f9c53ee8a02..748d6c7e97b 100644 --- a/src/common/low_precision_transformations/src/depth_to_space.cpp +++ b/src/common/low_precision_transformations/src/depth_to_space.cpp @@ -9,13 +9,11 @@ #include "low_precision/network_helper.hpp" #include "itt.hpp" -using namespace ngraph; -using namespace ngraph::pass; using namespace ngraph::pass::low_precision; DepthToSpaceTransformation::DepthToSpaceTransformation(const Params& params) : TransparentBaseTransformation(params) { MATCHER_SCOPE(DepthToSpaceTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -29,7 +27,7 @@ DepthToSpaceTransformation::DepthToSpaceTransformation(const Params& params) : T this->register_matcher(m, callback); } -bool DepthToSpaceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { +bool DepthToSpaceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr layer) const { if (!LayerTransformation::canBeTransformed(context, layer)) { return false; } diff --git a/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp b/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp index 2b03ff829f4..d1531674dc2 100644 --- a/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/eliminate_fake_quantize.cpp @@ -17,12 +17,12 @@ namespace low_precision { EliminateFakeQuantizeTransformation::EliminateFakeQuantizeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FuseMultiplyToFakeQuantizeTransformation); - const auto matcher = pattern::wrap_type({ + const auto matcher = pattern::wrap_type({ pattern::any_input(), - pattern::wrap_type(), - pattern::wrap_type(), - pattern::wrap_type(), - pattern::wrap_type() + pattern::wrap_type(), + pattern::wrap_type(), + pattern::wrap_type(), + pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { @@ -47,8 +47,8 @@ bool EliminateFakeQuantizeTransformation::transform(TransformationContext& conte } namespace { -bool check_interval(const std::shared_ptr& fq, - const std::shared_ptr& constant, +bool check_interval(const std::shared_ptr& fq, + const std::shared_ptr& constant, const float value, const float max_diff, const bool exact_comparison) noexcept { @@ -67,14 +67,14 @@ bool check_interval(const std::shared_ptr& fq, } if (need_to_check_intervals) { - auto tmp_fq = as_type_ptr(fq->clone_with_new_inputs({ + auto tmp_fq = as_type_ptr(fq->clone_with_new_inputs({ constant, fq->get_input_node_shared_ptr(1), fq->get_input_node_shared_ptr(2), fq->get_input_node_shared_ptr(3), fq->get_input_node_shared_ptr(4)})); auto result = NetworkHelper::fold_fake_quantize(tmp_fq, false); - const auto result_constant = as_type_ptr(result); + const auto result_constant = as_type_ptr(result); if (result_constant == nullptr) { return false; } @@ -90,7 +90,7 @@ bool check_interval(const std::shared_ptr& fq, return true; } -bool check_intervals(const std::shared_ptr& fakeQuantize) { +bool check_intervals(const std::shared_ptr& fakeQuantize) { const auto& element_type = fakeQuantize->get_output_element_type(0); const auto levels = fakeQuantize->get_levels(); const auto min_value = DataPrecision::getMinValue(element_type, levels); @@ -100,15 +100,19 @@ bool check_intervals(const std::shared_ptr& fakeQuantize) const auto exact_comparison = !element_type.is_integral(); return - check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(1)), min_value, max_diff, exact_comparison) && - check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(2)), max_value, max_diff, exact_comparison) && - check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(3)), min_value, max_diff, true) && - check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(4)), max_value, max_diff, true); + check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(1)), + min_value, max_diff, exact_comparison) && + check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(2)), + max_value, max_diff, exact_comparison) && + check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(3)), + min_value, max_diff, true) && + check_interval(fakeQuantize, ov::as_type_ptr(fakeQuantize->get_input_node_shared_ptr(4)), + max_value, max_diff, true); } } // namespace bool EliminateFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - const auto fakeQuantize = ov::as_type_ptr(operation); + const auto fakeQuantize = ov::as_type_ptr(operation); OPENVINO_ASSERT(fakeQuantize != nullptr, "unexpected operation type"); const auto& input_type = fakeQuantize->get_input_element_type(0); diff --git a/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp b/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp index 9ee2f1dd91f..f9597db5d49 100644 --- a/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/eltwise_base_transformation.cpp @@ -60,14 +60,14 @@ bool EltwiseBaseTransformation::canBeTransformed(const TransformationContext& co } static bool isTargetType(const std::shared_ptr node) { - return node != nullptr && (ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node)); + return node != nullptr && (ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node)); } static std::shared_ptr getDataParent(const std::shared_ptr branchData) { std::shared_ptr parent = branchData; - while (ov::is_type(parent)) { + while (ov::is_type(parent)) { parent = parent->get_input_node_shared_ptr(0); } @@ -101,7 +101,7 @@ static bool isBranchHaveMultipleConsumers(const std::shared_ptr branchData return true; } const auto new_parent = parent->get_input_node_shared_ptr(0); - parent = !ov::is_type(new_parent) ? new_parent : parent->get_input_node_shared_ptr(1); + parent = !ov::is_type(new_parent) ? new_parent : parent->get_input_node_shared_ptr(1); } return several_consumers(parent); } @@ -109,12 +109,12 @@ static bool isBranchHaveMultipleConsumers(const std::shared_ptr branchData // return branch index with FP32 precision after eltwise transformation int EltwiseBaseTransformation::getNotEmpty(const std::shared_ptr& eltwise) const { const FakeQuantizeDequantization dequantization1 = pass::low_precision::NetworkHelper::getDequantization(eltwise, defaultPrecisions, 0ul); - if (ov::as_type(dequantization1.data.get_node())) { + if (ov::as_type(dequantization1.data.get_node())) { return -1; } const FakeQuantizeDequantization dequantization2 = pass::low_precision::NetworkHelper::getDequantization(eltwise, defaultPrecisions, 1ul); - if (ov::as_type(dequantization2.data.get_node())) { + if (ov::as_type(dequantization2.data.get_node())) { return -1; } @@ -142,10 +142,10 @@ int EltwiseBaseTransformation::getNotEmpty(const std::shared_ptr& eltwise) } } - const std::shared_ptr fakeQuantize1 = - ov::as_type_ptr(dequantization1.data.get_node_shared_ptr()); - const std::shared_ptr fakeQuantize2 = - ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); + const std::shared_ptr fakeQuantize1 = + ov::as_type_ptr(dequantization1.data.get_node_shared_ptr()); + const std::shared_ptr fakeQuantize2 = + ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); if (fakeQuantize1 && !fakeQuantize2) { return 0; @@ -164,11 +164,11 @@ int EltwiseBaseTransformation::getNotEmpty(const std::shared_ptr& eltwise) return 1; } - if (ov::is_type(dequantization1.data.get_node())) { + if (ov::is_type(dequantization1.data.get_node())) { return 0; } - if (ov::is_type(dequantization2.data.get_node())) { + if (ov::is_type(dequantization2.data.get_node())) { return 1; } @@ -211,18 +211,18 @@ std::pair EltwiseBaseTransformation::getMultiplyConstBranch(const std: const std::shared_ptr parent2 = eltwise->get_input_node_shared_ptr(1); const auto dequantization2 = NetworkHelper::getDequantization(eltwise, defaultPrecisions, 1); - std::shared_ptr constParent = dequantization1.empty() ? - ov::as_type_ptr(parent1) : - ov::as_type_ptr(dequantization1.data.get_node_shared_ptr()); - std::shared_ptr multiplyParent = ov::as_type_ptr(parent2); + std::shared_ptr constParent = dequantization1.empty() ? + ov::as_type_ptr(parent1) : + ov::as_type_ptr(dequantization1.data.get_node_shared_ptr()); + std::shared_ptr multiplyParent = ov::as_type_ptr(parent2); int multiplyBranch = 1; if (constParent == nullptr || multiplyParent == nullptr) { constParent = dequantization2.empty() ? - ov::as_type_ptr(parent2) : - ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); - multiplyParent = ov::as_type_ptr(parent1); + ov::as_type_ptr(parent2) : + ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); + multiplyParent = ov::as_type_ptr(parent1); multiplyBranch = 0; } @@ -233,14 +233,14 @@ std::pair EltwiseBaseTransformation::getMultiplyConstBranch(const std: auto multiplyParentParent1 = multiplyParent->get_input_node_shared_ptr(0); auto multiplyParentParent2 = multiplyParent->get_input_node_shared_ptr(1); - auto multiplyParentParent = ov::as_type_ptr(multiplyParentParent1); - auto multiplyParentConst = ov::as_type_ptr(multiplyParentParent2); + auto multiplyParentParent = ov::as_type_ptr(multiplyParentParent1); + auto multiplyParentConst = ov::as_type_ptr(multiplyParentParent2); int multiplyActBranch = 0; if (multiplyParentConst == nullptr) { - multiplyParentParent = ov::as_type_ptr(multiplyParentParent2); - multiplyParentConst = ov::as_type_ptr(multiplyParentParent1); + multiplyParentParent = ov::as_type_ptr(multiplyParentParent2); + multiplyParentConst = ov::as_type_ptr(multiplyParentParent1); multiplyActBranch = 1; } diff --git a/src/common/low_precision_transformations/src/fake_quantize.cpp b/src/common/low_precision_transformations/src/fake_quantize.cpp index 3dc308962b2..d8631955fe6 100644 --- a/src/common/low_precision_transformations/src/fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fake_quantize.cpp @@ -21,7 +21,7 @@ FakeQuantizeTransformation::FakeQuantizeTransformation(const Params& params) : L MATCHER_SCOPE(FakeQuantizeTransformation); auto matcher = pattern::wrap_type(); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -220,7 +220,7 @@ std::shared_ptr FakeQuantizeTransformation::fuseElementwis matcherPass->register_new_node(newFakeQuantize); replace_node(fakeQuantize, newFakeQuantize); - ngraph::copy_runtime_info({ fakeQuantize, eltwise }, newFakeQuantize); + ov::copy_runtime_info({ fakeQuantize, eltwise }, newFakeQuantize); newFakeQuantize->set_friendly_name(fakeQuantize->get_friendly_name()); return newFakeQuantize; } diff --git a/src/common/low_precision_transformations/src/fold_convert.cpp b/src/common/low_precision_transformations/src/fold_convert.cpp index 5ad2730f545..58a75ff941f 100644 --- a/src/common/low_precision_transformations/src/fold_convert.cpp +++ b/src/common/low_precision_transformations/src/fold_convert.cpp @@ -16,7 +16,7 @@ namespace low_precision { FoldConvertTransformation::FoldConvertTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FoldConvertTransformation); - auto subtract = pattern::wrap_type(); + auto subtract = pattern::wrap_type(); auto matcher = std::make_shared(subtract, matcher_name); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { @@ -38,12 +38,12 @@ bool FoldConvertTransformation::transform(TransformationContext& context, ngraph auto foldConvert = [&](const size_t branch) { const auto convert = subtract->get_input_node_shared_ptr(branch); - if (!ov::is_type(convert) || !ov::is_type(convert->get_input_node_shared_ptr(0))) { + if (!ov::is_type(convert) || !ov::is_type(convert->get_input_node_shared_ptr(0))) { return; } const auto resultConstant = ngraph::pass::low_precision::foldConvert(convert->input_value(0), convert->get_output_element_type(0)); - assert(ov::is_type(resultConstant)); + assert(ov::is_type(resultConstant)); replace_node(convert, resultConstant); updateOutput(context, resultConstant, convert); @@ -57,10 +57,10 @@ bool FoldConvertTransformation::transform(TransformationContext& context, ngraph bool FoldConvertTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { return - (ov::is_type(operation->get_input_node_ptr(1)) && - ov::is_type(operation->get_input_node_ptr(1)->get_input_node_ptr(0))) || - (ov::is_type(operation->get_input_node_ptr(0)) && - ov::is_type(operation->get_input_node_ptr(0)->get_input_node_ptr(0))); + (ov::is_type(operation->get_input_node_ptr(1)) && + ov::is_type(operation->get_input_node_ptr(1)->get_input_node_ptr(0))) || + (ov::is_type(operation->get_input_node_ptr(0)) && + ov::is_type(operation->get_input_node_ptr(0)->get_input_node_ptr(0))); } bool FoldConvertTransformation::isPrecisionPreserved(std::shared_ptr layer) const noexcept { diff --git a/src/common/low_precision_transformations/src/fold_fake_quantize.cpp b/src/common/low_precision_transformations/src/fold_fake_quantize.cpp index 010ac6f2b5f..3246319b7ba 100644 --- a/src/common/low_precision_transformations/src/fold_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fold_fake_quantize.cpp @@ -19,7 +19,7 @@ namespace low_precision { FoldFakeQuantizeTransformation::FoldFakeQuantizeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FoldFakeQuantizeTransformation); - auto fakeQuantize = pattern::wrap_type(); + auto fakeQuantize = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -34,7 +34,7 @@ FoldFakeQuantizeTransformation::FoldFakeQuantizeTransformation(const Params& par } bool FoldFakeQuantizeTransformation::transform(TransformationContext& context, ngraph::pattern::Matcher &m) { - const auto fakeQuantize = ov::as_type_ptr(m.get_match_root()); + const auto fakeQuantize = ov::as_type_ptr(m.get_match_root()); if (fakeQuantize == nullptr) { return false; } @@ -49,7 +49,7 @@ bool FoldFakeQuantizeTransformation::transform(TransformationContext& context, n } const auto resultConstant = NetworkHelper::fold_fake_quantize(fakeQuantize, false); - if (ov::is_type(resultConstant)) { + if (ov::is_type(resultConstant)) { replace_node(fakeQuantize, resultConstant); return true; } @@ -58,13 +58,13 @@ bool FoldFakeQuantizeTransformation::transform(TransformationContext& context, n } bool FoldFakeQuantizeTransformation::isConstantOutput(std::shared_ptr node) const { - const auto fakeQuantize = ov::as_type_ptr(node); + const auto fakeQuantize = ov::as_type_ptr(node); if (!fakeQuantize) { return false; } - const auto outputLow = as_type_ptr(fakeQuantize->get_input_node_shared_ptr(3)); - const auto outputHigh = as_type_ptr(fakeQuantize->get_input_node_shared_ptr(4)); + const auto outputLow = as_type_ptr(fakeQuantize->get_input_node_shared_ptr(3)); + const auto outputHigh = as_type_ptr(fakeQuantize->get_input_node_shared_ptr(4)); if (outputLow == nullptr || outputHigh == nullptr) { return false; @@ -81,7 +81,7 @@ bool FoldFakeQuantizeTransformation::canBeTransformed(const TransformationContex return false; } - const auto fq = ov::as_type_ptr(op); + const auto fq = ov::as_type_ptr(op); if (!fq) { return false; } diff --git a/src/common/low_precision_transformations/src/fuse_convert.cpp b/src/common/low_precision_transformations/src/fuse_convert.cpp index 1780d85bc1e..dd27aab81ba 100644 --- a/src/common/low_precision_transformations/src/fuse_convert.cpp +++ b/src/common/low_precision_transformations/src/fuse_convert.cpp @@ -21,11 +21,11 @@ namespace low_precision { FuseConvertTransformation::FuseConvertTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FuseConvertTransformation); - auto multiply = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); - auto subtract = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); - auto add = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); - auto fakeQuantize = pattern::wrap_type({ - pattern::wrap_type({pattern::wrap_type()}), + auto multiply = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto subtract = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto add = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto fakeQuantize = pattern::wrap_type({ + pattern::wrap_type({pattern::wrap_type()}), pattern::any_input(), pattern::any_input(), pattern::any_input(), @@ -48,13 +48,13 @@ FuseConvertTransformation::FuseConvertTransformation(const Params& params) : Lay namespace { std::shared_ptr removeConvertIfPossibleForSubtract( - const std::shared_ptr& convert, - const std::shared_ptr& subtract) { + const std::shared_ptr& convert, + const std::shared_ptr& subtract) { std::shared_ptr newSubtract; const element::Type precisionBeforeConvert = convert->input(0).get_element_type(); if (NetworkHelper::checkConstantValuePrecision(precisionBeforeConvert, subtract->get_input_node_shared_ptr(1))) { - newSubtract = std::make_shared>( + newSubtract = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{}, ov::op::TemporaryReplaceOutputType(convert->input_value(0), element::f32).get(), ov::op::TemporaryReplaceOutputType(subtract->input_value(1), element::f32).get()); @@ -73,27 +73,27 @@ bool FuseConvertTransformation::transform(TransformationContext& context, ngraph return false; } - const auto convert = ov::as_type_ptr(op->get_input_node_shared_ptr(0)); + const auto convert = ov::as_type_ptr(op->get_input_node_shared_ptr(0)); auto parent = convert->input_value(0); - if (ov::is_type(parent.get_node_shared_ptr())) { + if (ov::is_type(parent.get_node_shared_ptr())) { auto convertedConstant = foldConvert(parent, convert->get_convert_element_type()); NetworkHelper::copyInfo(parent.get_node_shared_ptr(), convertedConstant); replace_node(convert, convertedConstant); } else { std::shared_ptr newOp; - if (ov::is_type(op)) { - auto subtract = ov::as_type_ptr(op); + if (ov::is_type(op)) { + auto subtract = ov::as_type_ptr(op); newOp = removeConvertIfPossibleForSubtract(convert, subtract); - } else if (ov::is_type(op)) { - newOp = std::make_shared>( + } else if (ov::is_type(op)) { + newOp = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{}, ov::op::TemporaryReplaceOutputType(convert->input_value(0), element::f32).get(), ov::op::TemporaryReplaceOutputType(op->input_value(1), element::f32).get()); NetworkHelper::setOutDataPrecisionForTypeRelaxed(newOp, op->get_output_element_type(0)); replace_node(op, newOp); - } else if (ov::is_type(op)) { - newOp = std::make_shared>( + } else if (ov::is_type(op)) { + newOp = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{}, ov::op::TemporaryReplaceOutputType(convert->input_value(0), element::f32).get(), ov::op::TemporaryReplaceOutputType(op->input_value(1), element::f32).get()); @@ -118,7 +118,7 @@ bool FuseConvertTransformation::canBeTransformed(const TransformationContext& co return false; } - const auto convert = ov::as_type_ptr(op->get_input_node_shared_ptr(0)); + const auto convert = ov::as_type_ptr(op->get_input_node_shared_ptr(0)); // issue #40395 if (convert == nullptr) { return false; diff --git a/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp b/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp index 89f0edbde7d..f024cb2899b 100644 --- a/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fuse_multiply_to_fake_quantize.cpp @@ -18,7 +18,7 @@ namespace low_precision { FuseMultiplyToFakeQuantizeTransformation::FuseMultiplyToFakeQuantizeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FuseMultiplyToFakeQuantizeTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -39,15 +39,15 @@ bool FuseMultiplyToFakeQuantizeTransformation::transform(TransformationContext& } const auto parent = multiply->get_input_node_shared_ptr(0); - auto fakeQuantize = ov::as_type_ptr(parent); - const auto convert = ov::as_type_ptr(parent); + auto fakeQuantize = ov::as_type_ptr(parent); + const auto convert = ov::as_type_ptr(parent); if (convert) { - fakeQuantize = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); + fakeQuantize = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); } const auto multiplyConstant = multiply->get_input_node_shared_ptr(1); - if (!ov::is_type(multiplyConstant)) { + if (!ov::is_type(multiplyConstant)) { return false; } @@ -58,8 +58,8 @@ bool FuseMultiplyToFakeQuantizeTransformation::transform(TransformationContext& multiplyConstant : foldConvert(multiplyConstant, deqPrecision); - outputLowConst_f32 = fold(outputLowConst_f32, value); - outputHighConst_f32 = fold(outputHighConst_f32, value); + outputLowConst_f32 = fold(outputLowConst_f32, value); + outputHighConst_f32 = fold(outputHighConst_f32, value); const auto inputLow = foldConvert(fakeQuantize->input_value(1), deqPrecision); const auto inputHigh = foldConvert(fakeQuantize->input_value(2), deqPrecision); @@ -68,8 +68,8 @@ bool FuseMultiplyToFakeQuantizeTransformation::transform(TransformationContext& NetworkHelper::copyInfo(fakeQuantize->get_input_node_shared_ptr(3), outputLowConst_f32); NetworkHelper::copyInfo(fakeQuantize->get_input_node_shared_ptr(4), outputHighConst_f32); - auto newFakeQuantize = std::make_shared>( - opset1::FakeQuantize( + auto newFakeQuantize = std::make_shared>( + ov::opset1::FakeQuantize( fakeQuantize->input_value(0), inputLow, inputHigh, @@ -91,7 +91,7 @@ bool FuseMultiplyToFakeQuantizeTransformation::transform(TransformationContext& } bool FuseMultiplyToFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!ov::is_type(operation->get_input_node_shared_ptr(1))) { + if (!ov::is_type(operation->get_input_node_shared_ptr(1))) { return false; } @@ -104,11 +104,11 @@ bool FuseMultiplyToFakeQuantizeTransformation::canBeTransformed(const Transforma } const auto parent = operation->get_input_node_shared_ptr(0); - auto fq = ov::as_type_ptr(parent); - const auto convert = ov::as_type_ptr(parent); + auto fq = ov::as_type_ptr(parent); + const auto convert = ov::as_type_ptr(parent); if (convert) { - fq = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); + fq = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); } if (!fq) { diff --git a/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp b/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp index bc5419bf810..ab9e7db47f6 100644 --- a/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/fuse_subtract_to_fake_quantize.cpp @@ -17,7 +17,7 @@ namespace low_precision { FuseSubtractToFakeQuantizeTransformation::FuseSubtractToFakeQuantizeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(FuseSubtractToFakeQuantizeTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -38,15 +38,15 @@ bool FuseSubtractToFakeQuantizeTransformation::transform(TransformationContext& } const auto parent = subtract->get_input_node_shared_ptr(0); - auto fakeQuantize = ov::as_type_ptr(parent); - const auto convert = ov::as_type_ptr(parent); + auto fakeQuantize = ov::as_type_ptr(parent); + const auto convert = ov::as_type_ptr(parent); if (convert) { - fakeQuantize = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); + fakeQuantize = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); } const auto subtractConstant = subtract->get_input_node_shared_ptr(1); - if (!ov::is_type(subtractConstant)) { + if (!ov::is_type(subtractConstant)) { return false; } @@ -57,8 +57,8 @@ bool FuseSubtractToFakeQuantizeTransformation::transform(TransformationContext& subtractConstant : foldConvert(subtractConstant, deqPrecision); - outputLowConst_f32 = fold(outputLowConst_f32, value); - outputHighConst_f32 = fold(outputHighConst_f32, value); + outputLowConst_f32 = fold(outputLowConst_f32, value); + outputHighConst_f32 = fold(outputHighConst_f32, value); const auto inputLow = foldConvert(fakeQuantize->input_value(1), deqPrecision); const auto inputHigh = foldConvert(fakeQuantize->input_value(2), deqPrecision); @@ -67,8 +67,8 @@ bool FuseSubtractToFakeQuantizeTransformation::transform(TransformationContext& NetworkHelper::copyInfo(fakeQuantize->get_input_node_shared_ptr(3), outputLowConst_f32); NetworkHelper::copyInfo(fakeQuantize->get_input_node_shared_ptr(4), outputHighConst_f32); - auto newFakeQuantize = std::make_shared>( - opset1::FakeQuantize( + auto newFakeQuantize = std::make_shared>( + ov::opset1::FakeQuantize( fakeQuantize->input_value(0), inputLow, inputHigh, @@ -85,7 +85,7 @@ bool FuseSubtractToFakeQuantizeTransformation::transform(TransformationContext& } bool FuseSubtractToFakeQuantizeTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!ov::is_type(operation->get_input_node_shared_ptr(1))) { + if (!ov::is_type(operation->get_input_node_shared_ptr(1))) { return false; } @@ -100,20 +100,20 @@ bool FuseSubtractToFakeQuantizeTransformation::canBeTransformed(const Transforma const auto children = operation->get_output_target_inputs(0); for (const auto& target : children) { - const auto convolution = ov::is_type(target.get_node()); - const auto groupConvolution = ov::is_type(target.get_node()); - const auto convolutionBackpropData = ov::is_type(target.get_node()); + const auto convolution = ov::is_type(target.get_node()); + const auto groupConvolution = ov::is_type(target.get_node()); + const auto convolutionBackpropData = ov::is_type(target.get_node()); if (convolution || groupConvolution || convolutionBackpropData) { return false; } } const auto parent = operation->get_input_node_shared_ptr(0); - auto fq = ov::as_type_ptr(parent); - const auto convert = ov::as_type_ptr(parent); + auto fq = ov::as_type_ptr(parent); + const auto convert = ov::as_type_ptr(parent); if (convert) { - fq = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); + fq = ov::as_type_ptr(convert->get_input_node_shared_ptr(0)); } if (!fq) { diff --git a/src/common/low_precision_transformations/src/group_convolution.cpp b/src/common/low_precision_transformations/src/group_convolution.cpp index 6691f4bdb44..7e2cdc5d835 100644 --- a/src/common/low_precision_transformations/src/group_convolution.cpp +++ b/src/common/low_precision_transformations/src/group_convolution.cpp @@ -18,7 +18,7 @@ namespace low_precision { GroupConvolutionTransformation::GroupConvolutionTransformation(const Params& params) : ConvolutionTransformation(params) { MATCHER_SCOPE(GroupConvolutionTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); diff --git a/src/common/low_precision_transformations/src/layer_transformation.cpp b/src/common/low_precision_transformations/src/layer_transformation.cpp index 6a496f15657..c0b1769fd8e 100644 --- a/src/common/low_precision_transformations/src/layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/layer_transformation.cpp @@ -16,6 +16,7 @@ #include #include #include "itt.hpp" +#include "openvino/util/log.hpp" namespace ngraph { namespace pass { @@ -139,9 +140,9 @@ bool LayerTransformation::canSubtractBeHandled(const std::shared_ptr& op, const auto parent = dequantization.subtract->input_value(1).get_node_shared_ptr(); - if (ov::is_type(parent)) { + if (ov::is_type(parent)) { return true; - } else if (ov::is_type(parent) && ov::is_type(parent->get_input_node_shared_ptr(0))) { + } else if (ov::is_type(parent) && ov::is_type(parent->get_input_node_shared_ptr(0))) { const auto constant = parent->get_input_node_shared_ptr(0); const auto constantType = constant->output(0).get_element_type(); return operationType == constantType; @@ -403,7 +404,7 @@ void LayerTransformation::updateOutput( // TODO: not tested!!! for (auto output : lastNode->outputs()) { for (auto input : output.get_target_inputs()) { - if (ov::is_type(input.get_node())) { + if (ov::is_type(input.get_node())) { const std::string originalName = originalNode->get_friendly_name(); originalNode->set_friendly_name(originalName + LayerTransformation::originalLayerPostfix); lastNode->set_friendly_name(originalName); @@ -428,9 +429,9 @@ void LayerTransformation::updateOutput( } } -void LayerTransformation::addPattern(ngraph::pass::GraphRewrite& pass, TransformationContext& context, std::shared_ptr patternRoot) { +void LayerTransformation::addPattern(ov::pass::GraphRewrite& pass, TransformationContext& context, std::shared_ptr patternRoot) { MATCHER_SCOPE(SingleNodeMatcher); - ngraph::graph_rewrite_callback internal_callback = [this, &context](ngraph::pattern::Matcher &m) { + ov::graph_rewrite_callback internal_callback = [this, &context](ov::pass::pattern::Matcher &m) { const bool result = transform(context, m); (void)result; #ifdef LPT_DISPLAY_PRECISION @@ -446,15 +447,15 @@ void LayerTransformation::addPattern(ngraph::pass::GraphRewrite& pass, Transform return false; }; // TODO: better name for matcher? required? - auto m = std::make_shared(patternRoot, matcher_name); + auto m = std::make_shared(patternRoot, matcher_name); auto match_pass = std::make_shared( m->get_name(), m, [m, internal_callback](const std::shared_ptr& node) -> bool { - NGRAPH_DEBUG << "Running matcher " << m->get_name() << " on " << node; + OPENVINO_DEBUG << "Running matcher " << m->get_name() << " on " << node; OV_PASS_CALLBACK(m); if (std::dynamic_pointer_cast(m)->match(node->output(0))) { - NGRAPH_DEBUG << "Matcher " << m->get_name() << " matched " << node; + OPENVINO_DEBUG << "Matcher " << m->get_name() << " matched " << node; bool status = internal_callback(*m.get()); // explicitly clear Matcher state because it holds pointers to matched nodes m->clear_state(); diff --git a/src/common/low_precision_transformations/src/low_precision.cpp b/src/common/low_precision_transformations/src/low_precision.cpp index 2254e37d055..3eb6ddb3202 100644 --- a/src/common/low_precision_transformations/src/low_precision.cpp +++ b/src/common/low_precision_transformations/src/low_precision.cpp @@ -27,6 +27,7 @@ #include "low_precision/propagate_precisions.hpp" #include "low_precision/align_quantization_parameters.hpp" +#include "openvino/util/log.hpp" #include "transformations/common_optimizations/lin_op_sequence_fusion.hpp" #include "low_precision/fold_convert.hpp" #include "low_precision/pull_reshape_through_dequantization.hpp" @@ -139,9 +140,9 @@ void make_matcher_type_relaxed(ngraph::pass::GraphRewrite* transformation) { m->get_name(), m, [m, callback](const std::shared_ptr& node) -> bool { - NGRAPH_DEBUG << "Running matcher " << m->get_name() << " on " << node; + OPENVINO_DEBUG << "Running matcher " << m->get_name() << " on " << node; if (std::dynamic_pointer_cast(m)->match(node->output(0))) { - NGRAPH_DEBUG << "Matcher " << m->get_name() << " matched " << node; + OPENVINO_DEBUG << "Matcher " << m->get_name() << " matched " << node; OV_PASS_CALLBACK(m); bool status = callback(*m.get()); // explicitly clear Matcher state because it holds pointers to matched nodes diff --git a/src/common/low_precision_transformations/src/markup_avg_pool_precision_preserved.cpp b/src/common/low_precision_transformations/src/markup_avg_pool_precision_preserved.cpp index 0221624f79e..d54c213a5c1 100644 --- a/src/common/low_precision_transformations/src/markup_avg_pool_precision_preserved.cpp +++ b/src/common/low_precision_transformations/src/markup_avg_pool_precision_preserved.cpp @@ -10,6 +10,7 @@ #include "low_precision/propagate_through_precision_preserved.hpp" #include "low_precision/update_shared_precision_preserved.hpp" #include "itt.hpp" +#include "openvino/pass/manager.hpp" using namespace ngraph; @@ -18,7 +19,7 @@ ngraph::pass::low_precision::MarkupAvgPoolPrecisionPreserved::MarkupAvgPoolPreci bool ngraph::pass::low_precision::MarkupAvgPoolPrecisionPreserved::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(MarkupAvgPoolPrecisionPreserved); - ngraph::pass::Manager manager; + ov::pass::Manager manager; manager.set_per_pass_validation(false); std::shared_ptr markupAvgPoolPrecision = manager.register_pass(); markupAvgPoolPrecision->add_matcher>(); diff --git a/src/common/low_precision_transformations/src/markup_quantization_granularity.cpp b/src/common/low_precision_transformations/src/markup_quantization_granularity.cpp index bbe448d8342..456afd3f938 100644 --- a/src/common/low_precision_transformations/src/markup_quantization_granularity.cpp +++ b/src/common/low_precision_transformations/src/markup_quantization_granularity.cpp @@ -57,7 +57,7 @@ bool ngraph::pass::low_precision::MarkupQuantizationGranularity::run_on_model(co continue; } - if (const auto multiSubGraph = ov::as_type_ptr(node)) { + if (const auto multiSubGraph = ov::as_type_ptr(node)) { for (size_t i = 0; i < multiSubGraph->get_internal_subgraphs_size(); i++) run_on_model(multiSubGraph->get_function(i)); continue; diff --git a/src/common/low_precision_transformations/src/mat_mul.cpp b/src/common/low_precision_transformations/src/mat_mul.cpp index c8970fb2d73..cfb336ddcad 100644 --- a/src/common/low_precision_transformations/src/mat_mul.cpp +++ b/src/common/low_precision_transformations/src/mat_mul.cpp @@ -21,12 +21,12 @@ using namespace ngraph::pass::low_precision; MatMulTransformation::MatMulTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(MatMulTransformation); - auto mul1 = pattern::wrap_type(); - auto mul2 = pattern::wrap_type(); - auto fq2 = pattern::wrap_type(); - auto matcher = pattern::wrap_type({ mul1, std::make_shared(OutputVector{ mul2, fq2 })}); + auto mul1 = pattern::wrap_type(); + auto mul2 = pattern::wrap_type(); + auto fq2 = pattern::wrap_type(); + auto matcher = pattern::wrap_type({ mul1, std::make_shared(OutputVector{ mul2, fq2 })}); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -39,18 +39,18 @@ MatMulTransformation::MatMulTransformation(const Params& params) : LayerTransfor } bool MatMulTransformation::transform(TransformationContext &context, ngraph::pattern::Matcher &m) { - std::shared_ptr matMul = ov::as_type_ptr(m.get_match_root()); + std::shared_ptr matMul = ov::as_type_ptr(m.get_match_root()); if ((matMul == nullptr) || !canBeTransformed(context, matMul)) { return false; } - matMul = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(matMul, defaultPrecisions)); + matMul = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(matMul, defaultPrecisions)); const auto dequantization1 = NetworkHelper::getDequantization(matMul, defaultPrecisions, 0); auto dequantization2 = NetworkHelper::getDequantization(matMul, defaultPrecisions, 1); if (dequantization2.empty()) { - const std::shared_ptr fakeQuantize = - ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); + const std::shared_ptr fakeQuantize = + ov::as_type_ptr(dequantization2.data.get_node_shared_ptr()); if (fakeQuantize != nullptr) { const QuantizationDetails quantizationDetails = QuantizationDetails::getDetails(fakeQuantize); @@ -80,7 +80,7 @@ bool MatMulTransformation::transform(TransformationContext &context, ngraph::pat dequantization2 = NetworkHelper::getDequantization(matMul, defaultPrecisions, 1); } - const std::shared_ptr newMatMul = std::make_shared>( + const std::shared_ptr newMatMul = std::make_shared>( std::vector({ deqPrecision, deqPrecision }), std::vector({ deqPrecision }), ov::op::TemporaryReplaceOutputType(dequantization1.data, deqPrecision).get(), ov::op::TemporaryReplaceOutputType(dequantization2.data, deqPrecision).get(), @@ -92,7 +92,7 @@ bool MatMulTransformation::transform(TransformationContext &context, ngraph::pat // dequantization with subtract on activations & constant weights if (dequantization1.subtract) { - auto broadcastShape = NetworkHelper::isScalarLike(ov::as_type_ptr(dequantization1.subtractConstant)) ? + auto broadcastShape = NetworkHelper::isScalarLike(ov::as_type_ptr(dequantization1.subtractConstant)) ? Shape(dequantization1.subtract->get_output_partial_shape(0).rank().get_length(), 1) : dequantization1.subtractConstant->get_shape(); @@ -105,25 +105,25 @@ bool MatMulTransformation::transform(TransformationContext &context, ngraph::pat broadcastShape[lastDataIdx] = weightsShape[firstWeightsIdx]; // broadcasted sub const to form [1, ..., 1, Y] - const auto broadcastedConst = fold( + const auto broadcastedConst = fold( dequantization1.subtractConstant, - opset1::Constant::create(ngraph::element::i32, { broadcastShape.size() }, broadcastShape)); + ov::opset1::Constant::create(ngraph::element::i32, { broadcastShape.size() }, broadcastShape)); // multiply by weights: [1, ..., 1, Y] x [Y, Z] => [1, ..., 1, Z] - const auto newSubConst = NetworkHelper::toScalarIfPossible(fold( + const auto newSubConst = NetworkHelper::toScalarIfPossible(fold( foldConvert(broadcastedConst, newMatMul->get_element_type()), foldConvert(newMatMul->input_value(1), newMatMul->get_element_type()), newMatMul->get_transpose_a(), newMatMul->get_transpose_b())); - const auto newSubtract = std::make_shared(newMatMul, newSubConst); + const auto newSubtract = std::make_shared(newMatMul, newSubConst); newSubtract->set_friendly_name(newMatMul->get_friendly_name() + "/DequantizationSubtract"); copy_runtime_info({ newSubtract, matMul }, newSubtract); parent = newSubtract; } - auto transpose = [](const std::shared_ptr& node) -> std::shared_ptr { + auto transpose = [](const std::shared_ptr& node) -> std::shared_ptr { const Shape outputShape = node->get_shape(); if (outputShape.size() < 2ul) { return node; @@ -133,16 +133,16 @@ bool MatMulTransformation::transform(TransformationContext &context, ngraph::pat std::iota(transposeConstant.begin(), transposeConstant.end(), 0); std::swap(*(transposeConstant.end() - 1), *(transposeConstant.end() - 2)); - auto order = opset1::Constant::create(element::u32, Shape{ transposeConstant.size() }, transposeConstant); - std::shared_ptr transposedConstant = fold(node, order); + auto order = ov::opset1::Constant::create(element::u32, Shape{ transposeConstant.size() }, transposeConstant); + std::shared_ptr transposedConstant = fold(node, order); return transposedConstant; }; const auto mulConst1 = matMul->get_transpose_a() ? transpose(dequantization1.multiplyConstant) : dequantization1.multiplyConstant; auto mulConst2 = matMul->get_transpose_b() ? transpose(dequantization2.multiplyConstant) : dequantization2.multiplyConstant; - if (NetworkHelper::isScalarLike(ov::as_type_ptr(mulConst2))) { - mulConst2 = NetworkHelper::toScalar(ov::as_type_ptr(mulConst2)); + if (NetworkHelper::isScalarLike(ov::as_type_ptr(mulConst2))) { + mulConst2 = NetworkHelper::toScalar(ov::as_type_ptr(mulConst2)); } else { const auto constShape = mulConst2->get_shape(); const size_t inputRank = matMul->get_input_partial_shape(0).rank().get_length(); @@ -152,17 +152,17 @@ bool MatMulTransformation::transform(TransformationContext &context, ngraph::pat Shape unsqueezeConstantShape(inputRank - constShape.size()); std::iota(unsqueezeConstantShape.begin(), unsqueezeConstantShape.end(), 0ul); - mulConst2 = fold( + mulConst2 = fold( mulConst2, - op::Constant::create(element::i32, Shape{ unsqueezeConstantShape.size() }, unsqueezeConstantShape)); + ov::op::v0::Constant::create(element::i32, Shape{ unsqueezeConstantShape.size() }, unsqueezeConstantShape)); } } - const auto newMulConst = NetworkHelper::toScalarIfPossible(fold( + const auto newMulConst = NetworkHelper::toScalarIfPossible(fold( mulConst1, foldConvert(mulConst2, element::f32))); - const auto newMultiply = std::make_shared>( + const auto newMultiply = std::make_shared>( std::vector{ deqPrecision, deqPrecision }, std::vector{ dequantization1.multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(parent, deqPrecision).get(), @@ -187,7 +187,7 @@ bool MatMulTransformation::canBeTransformed(const TransformationContext& context return false; } - std::shared_ptr matMul = ov::as_type_ptr(layer); + std::shared_ptr matMul = ov::as_type_ptr(layer); if (matMul == nullptr) { return false; } @@ -245,7 +245,7 @@ bool MatMulTransformation::canBeTransformed(const TransformationContext& context } } - const auto fakeQuantize = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); + const auto fakeQuantize = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); if (fakeQuantize) { if (!QuantizationDetails::outputLayoutIsSupported(fakeQuantize)) { return false; diff --git a/src/common/low_precision_transformations/src/multiply.cpp b/src/common/low_precision_transformations/src/multiply.cpp index c11c41776e3..f9cc75e2bca 100644 --- a/src/common/low_precision_transformations/src/multiply.cpp +++ b/src/common/low_precision_transformations/src/multiply.cpp @@ -24,7 +24,7 @@ namespace low_precision { MultiplyTransformation::MultiplyTransformation(const Params& params) : EltwiseBaseTransformation(params) { MATCHER_SCOPE(MultiplyTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -51,10 +51,10 @@ bool MultiplyTransformation::transform(TransformationContext& context, ngraph::p auto newMultiply = multiply; auto fold_fake_quantizes = [](std::shared_ptr& multiply, const size_t index) { - auto fakeQuantizeOnWeights = ov::as_type_ptr(multiply->get_input_node_shared_ptr(index)); + auto fakeQuantizeOnWeights = ov::as_type_ptr(multiply->get_input_node_shared_ptr(index)); if (fakeQuantizeOnWeights != nullptr) { auto result = NetworkHelper::fold_fake_quantize(fakeQuantizeOnWeights); - if (ov::is_type(result)) { + if (ov::is_type(result)) { replace_node(fakeQuantizeOnWeights, result); } } @@ -82,12 +82,12 @@ bool MultiplyTransformation::transform(TransformationContext& context, ngraph::p auto multiplyParentParent = multiplyParent.get_node_shared_ptr()->input_value(multiplyBranch.second); auto multiplyParentConst = multiplyParent.get_node_shared_ptr()->input_value(multiplyBranch.second == 0 ? 1 : 0); - newMultiply = std::make_shared>( + newMultiply = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{ multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(multiplyParentParent, element::f32).get(), ov::op::TemporaryReplaceOutputType( - fold( + fold( foldConvert(multiplyParentConst, element::f32), foldConvert(constParent, element::f32)), element::f32).get()); @@ -123,17 +123,17 @@ bool MultiplyTransformation::transform(TransformationContext& context, ngraph::p // before: Y = (SC1 * (X1 - SH1)) * (SC2 * X2) // after : Y = (SC1' * (X1 - SH1)) * (X2) , where : // SC1' = SC1 * SC2 - auto newMultiplyValuesFullPath = fold(multiplyValuesEmptyPath, multiplyValuesFullPath); + auto newMultiplyValuesFullPath = fold(multiplyValuesEmptyPath, multiplyValuesFullPath); OutputVector inputs{ {}, {} }; inputs[emptyPathIndex] = dequantizationEmptyPath.data; - inputs[fullPathIndex] = std::make_shared( + inputs[fullPathIndex] = std::make_shared( dequantizationFullPath.subtract == nullptr ? (dequantizationFullPath.convert == nullptr ? dequantizationFullPath.data : dequantizationFullPath.convert) : dequantizationFullPath.subtract, newMultiplyValuesFullPath); - newMultiply = std::make_shared>( + newMultiply = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(inputs[0], element::f32).get(), @@ -159,8 +159,8 @@ bool MultiplyTransformation::canBeTransformed(const TransformationContext& conte return false; } - const bool nonConstantData = !ov::is_type(dequantization1.data.get_node_shared_ptr()) && - !ov::is_type(dequantization2.data.get_node_shared_ptr()); + const bool nonConstantData = !ov::is_type(dequantization1.data.get_node_shared_ptr()) && + !ov::is_type(dequantization2.data.get_node_shared_ptr()); if (((dequantization1.empty() || dequantization2.empty()) && nonConstantData)) { return false; diff --git a/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp b/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp index 222c4e2341d..18201f56e76 100644 --- a/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp +++ b/src/common/low_precision_transformations/src/multiply_to_group_convolution.cpp @@ -17,7 +17,7 @@ MultiplyToGroupConvolutionTransformation::MultiplyToGroupConvolutionTransformati const Params& params, const PrecisionsRestriction::PrecisionsByPorts& restrictions) : LayerTransformation(params), restrictions(restrictions), groupSize(1ul) { MATCHER_SCOPE(MultiplyToGroupConvolutionTransformation); - auto matcher = pattern::wrap_type(); + auto matcher = pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -40,7 +40,7 @@ bool MultiplyToGroupConvolutionTransformation::transform(TransformationContext& auto input = multiply->get_input_node_shared_ptr(0); auto constant = multiply->get_input_node_shared_ptr(1); auto inputIndex = 0; - if (!ov::is_type(constant)) { + if (!ov::is_type(constant)) { input = multiply->get_input_node_shared_ptr(1); constant = multiply->get_input_node_shared_ptr(0); inputIndex = 1; @@ -108,14 +108,14 @@ bool MultiplyToGroupConvolutionTransformation::transform(TransformationContext& weightsShape[0] = group; weightsShape[1] = outputChannelsCount / group; weightsShape[2] = inputChannelsCount / group; - const auto weightsNode = std::make_shared(weightsPrecision, weightsShape, weightsBuffer); + const auto weightsNode = std::make_shared(weightsPrecision, weightsShape, weightsBuffer); const size_t spatialDimsSize = pShape.rank().get_length() - 2; ngraph::Strides strides(spatialDimsSize, 1ul); ngraph::CoordinateDiff pads(spatialDimsSize, 0ul); ngraph::Strides dilations(spatialDimsSize, 1ul); - const auto convolution = std::make_shared>( + const auto convolution = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{ element::f32 }, ov::op::TemporaryReplaceOutputType(dequantization.data, element::f32).get(), @@ -128,9 +128,9 @@ bool MultiplyToGroupConvolutionTransformation::transform(TransformationContext& std::shared_ptr lastNode = convolution; if (dequantization.subtract != nullptr) { - lastNode = std::make_shared( + lastNode = std::make_shared( convolution, - fold(foldConvert(dequantization.subtractConstant, element::f32))); + fold(foldConvert(dequantization.subtractConstant, element::f32))); lastNode->set_friendly_name(convolution->get_friendly_name() + "/Add"); } @@ -164,15 +164,15 @@ bool MultiplyToGroupConvolutionTransformation::canBeTransformed(const Transforma Shape constShape; int inputIndex; - if (const auto constant = ov::as_type_ptr(operation->get_input_node_shared_ptr(1))) { + if (const auto constant = ov::as_type_ptr(operation->get_input_node_shared_ptr(1))) { inputIndex = 0; constShape = constant->get_shape(); - if (ov::is_type(operation->get_input_node_shared_ptr(0)) || - (ov::is_type(operation->get_input_node_shared_ptr(0)) && - ov::is_type(operation->get_input_node_shared_ptr(0)->get_input_node_shared_ptr(0)))) { + if (ov::is_type(operation->get_input_node_shared_ptr(0)) || + (ov::is_type(operation->get_input_node_shared_ptr(0)) && + ov::is_type(operation->get_input_node_shared_ptr(0)->get_input_node_shared_ptr(0)))) { return false; } - } else if (const auto constant = ov::as_type_ptr(operation->get_input_node_shared_ptr(0))) { + } else if (const auto constant = ov::as_type_ptr(operation->get_input_node_shared_ptr(0))) { inputIndex = 1; constShape = constant->get_shape(); } else { @@ -210,7 +210,7 @@ bool MultiplyToGroupConvolutionTransformation::canBeTransformedToGroupConvolutio const auto parent0 = layer->get_input_node_shared_ptr(0); const auto parent1 = layer->get_input_node_shared_ptr(1); - if (!ov::is_type(parent0) && !ov::is_type(parent1)) { + if (!ov::is_type(parent0) && !ov::is_type(parent1)) { return false; } @@ -225,10 +225,10 @@ bool MultiplyToGroupConvolutionTransformation::canBeTransformedToGroupConvolutio bool MultiplyToGroupConvolutionTransformation::isDynamicOrScalar(const std::shared_ptr& node) { auto getConstantIndex = [](const std::shared_ptr& node) -> int { - if (ov::is_type(node->get_input_node_shared_ptr(1))) { + if (ov::is_type(node->get_input_node_shared_ptr(1))) { return 1; } - if (ov::is_type(node->get_input_node_shared_ptr(0))) { + if (ov::is_type(node->get_input_node_shared_ptr(0))) { return 0; } return -1; diff --git a/src/common/low_precision_transformations/src/mvn.cpp b/src/common/low_precision_transformations/src/mvn.cpp index a58038b856d..1f0cb4d1088 100644 --- a/src/common/low_precision_transformations/src/mvn.cpp +++ b/src/common/low_precision_transformations/src/mvn.cpp @@ -44,11 +44,11 @@ std::shared_ptr createNewScalesConst(const ngraph::op::Con MVNTransformation::MVNTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(MVNTransformation); auto matcher = std::make_shared(OutputVector{ - pattern::wrap_type({ pattern::wrap_type() }), - pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }) + pattern::wrap_type({ pattern::wrap_type() }), + pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }) }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -84,7 +84,7 @@ bool MVNTransformation::canBeTransformed(const TransformationContext& context, s } else { // MVN-6 allows negative values in reduction axes: [-r, r-1] // given static rank of input data of MVN node, we can recover the exact axis number - auto axis_set = ov::as_type_ptr(mvn->get_input_node_shared_ptr(1))->cast_vector(); + auto axis_set = ov::as_type_ptr(mvn->get_input_node_shared_ptr(1))->cast_vector(); Dimension::value_type ndims = 0; if (std::any_of(axis_set.begin(), axis_set.end(), [](int64_t v) { return v < 0; })) { @@ -166,10 +166,10 @@ bool MVNTransformation::transform(TransformationContext &context, ngraph::patter NetworkHelper::setOutDataPrecisionForTypeRelaxed(newMVN, deqPrecision); NetworkHelper::copyInfo(mvn, newMVN); - auto newMultiply = std::make_shared>( - opset1::Multiply(newMVN, newScalesConst), + auto newMultiply = std::make_shared>( + ov::opset1::Multiply(newMVN, newScalesConst), mvn->get_output_element_type(0)); - ngraph::copy_runtime_info({ mvn, newMultiply }, newMultiply); + ov::copy_runtime_info({ mvn, newMultiply }, newMultiply); NetworkHelper::insertDequantizationAfter(mvn, newMultiply, newMVN); diff --git a/src/common/low_precision_transformations/src/network_helper.cpp b/src/common/low_precision_transformations/src/network_helper.cpp index 044bf8622e9..05654ae8ae4 100644 --- a/src/common/low_precision_transformations/src/network_helper.cpp +++ b/src/common/low_precision_transformations/src/network_helper.cpp @@ -22,8 +22,9 @@ #include "low_precision/rt_info/precision_preserved_attribute.hpp" #include "low_precision/rt_info/intervals_alignment_attribute.hpp" #include "low_precision/rt_info/quantization_alignment_attribute.hpp" -#include "ngraph/opsets/opset3.hpp" -#include "ngraph/opsets/opset6.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/opsets/opset3.hpp" +#include "openvino/opsets/opset6.hpp" #include "transformations/utils/utils.hpp" namespace ngraph { @@ -60,13 +61,13 @@ std::vector> NetworkHelper::consumers(std::shared_ptr& op) { const auto isNotConstantPathOperation = [](const std::shared_ptr& node) -> bool { - return ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node) || - ov::is_type(node); + return ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node) || + ov::is_type(node); }; if (isNotConstantPathOperation(op)) { @@ -96,8 +97,8 @@ bool NetworkHelper::isConstantPath(const std::shared_ptr& op) { return true; } -std::shared_ptr NetworkHelper::foldDequantizationConstant( - const std::shared_ptr& foldingConstant, +std::shared_ptr NetworkHelper::foldDequantizationConstant( + const std::shared_ptr& foldingConstant, const std::shared_ptr& operation, const size_t outIdx) { OutputVector inputs = operation->input_values(); @@ -116,7 +117,7 @@ std::shared_ptr NetworkHelper::foldDequantizationConstant( // constant folding of constant op->constant_fold(outputs, inputs); - const auto result = ov::as_type_ptr(outputs[outIdx].get_node_shared_ptr()); + const auto result = ov::as_type_ptr(outputs[outIdx].get_node_shared_ptr()); if (result == nullptr) { THROW_TRANSFORMATION_EXCEPTION << "result of constant folding is not constant"; } @@ -184,9 +185,9 @@ size_t NetworkHelper::getInputChannelsCount(std::shared_ptr layer) { } size_t NetworkHelper::getGroupsCount(std::shared_ptr layer) { - if (ov::is_type(layer)) { + if (ov::is_type(layer)) { return 1; - } else if (ov::is_type(layer)) { + } else if (ov::is_type(layer)) { return layer->get_input_partial_shape(1)[0].get_length(); // input weights for opset1::GC is in format GOI..., see the specification } else { THROW_TRANSFORMATION_EXCEPTION << "Invalid layer type of " << layer->get_friendly_name() << "; expected Convolution or GroupConvolution"; @@ -197,7 +198,7 @@ void NetworkHelper::removeLayer(std::shared_ptr layer) { ngraph::replace_output_update_name(layer->output(0), layer->input_value(0)); } -std::shared_ptr NetworkHelper::swapMultiplyAndAdd(std::shared_ptr addAfterMultiply, const int multiplyBranch) { +std::shared_ptr NetworkHelper::swapMultiplyAndAdd(std::shared_ptr addAfterMultiply, const int multiplyBranch) { // Multiply --> Add(addAfterMultiply) ==> Add(new) --> Multiply(new) // That means x*a + b ==> (x + b/a)*a; tries to fold b/a const auto multiply = addAfterMultiply->get_input_node_shared_ptr(multiplyBranch); @@ -205,13 +206,13 @@ std::shared_ptr NetworkHelper::swapMultiplyAndAdd(std::shared_ptrget_input_node_shared_ptr(0); const auto multiplyParent2 = multiply->get_input_node_shared_ptr(1); - auto multiplyInput = ov::as_type_ptr(multiplyParent1); - auto multiplyConst = ov::as_type_ptr(multiplyParent2); + auto multiplyInput = ov::as_type_ptr(multiplyParent1); + auto multiplyConst = ov::as_type_ptr(multiplyParent2); int multiplyInputBranch = 0; if (multiplyConst == nullptr) { - multiplyInput = ov::as_type_ptr(multiplyParent2); - multiplyConst = ov::as_type_ptr(multiplyParent1); + multiplyInput = ov::as_type_ptr(multiplyParent2); + multiplyConst = ov::as_type_ptr(multiplyParent1); multiplyInputBranch = 1; } @@ -219,9 +220,9 @@ std::shared_ptr NetworkHelper::swapMultiplyAndAdd(std::shared_ptrinput_value(multiplyInputBranch); - auto a = as_type_ptr(multiply->get_input_node_shared_ptr(multiplyInputBranch == 0 ? 1 : 0)); - auto b = as_type_ptr(addAfterMultiply->get_input_node_shared_ptr(multiplyBranch == 0 ? 1 : 0)); - std::shared_ptr bDivA; + auto a = as_type_ptr(multiply->get_input_node_shared_ptr(multiplyInputBranch == 0 ? 1 : 0)); + auto b = as_type_ptr(addAfterMultiply->get_input_node_shared_ptr(multiplyBranch == 0 ? 1 : 0)); + std::shared_ptr bDivA; const auto aPShape = a->get_output_partial_shape(0); assert(aPShape.is_static()); @@ -251,30 +252,30 @@ std::shared_ptr NetworkHelper::swapMultiplyAndAdd(std::shared_ptrget_output_element_type(0); - bDivA = std::make_shared( + bDivA = std::make_shared( aPrecision, aBroadcasted ? bShape : aShape, bDivAValues); } else { - b = as_type_ptr(foldConvert(b->output(0), element::f32)); - a = as_type_ptr(foldConvert(a->output(0), element::f32)); - bDivA = as_type_ptr(fold(b->output(0), a->output(0))); + b = as_type_ptr(foldConvert(b->output(0), element::f32)); + a = as_type_ptr(foldConvert(a->output(0), element::f32)); + bDivA = as_type_ptr(fold(b->output(0), a->output(0))); // TODO: issue #49868 - bDivA = as_type_ptr(foldConvert(bDivA->output(0), a->get_element_type())); + bDivA = as_type_ptr(foldConvert(bDivA->output(0), a->get_element_type())); } OutputVector inputs{ {}, {} }; inputs[0] = x; inputs[1] = bDivA->output(0); - std::shared_ptr newAdd = std::make_shared>( + std::shared_ptr newAdd = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ x.get_element_type() }, ov::op::TemporaryReplaceOutputType(inputs[0], element::f32).get(), ov::op::TemporaryReplaceOutputType(inputs[1], element::f32).get()); copyInfo(addAfterMultiply, newAdd); - auto newMultiply = std::make_shared>( + auto newMultiply = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ multiply->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(newAdd->output(0), element::f32).get(), @@ -339,7 +340,7 @@ void NetworkHelper::copyInfo(const std::shared_ptr& source, const std::sha copyInfo(std::vector>{ source }, std::vector>{ target }, overrideName); } -bool NetworkHelper::isScalarLike(std::shared_ptr constant) { +bool NetworkHelper::isScalarLike(std::shared_ptr constant) { // ticket #48857 // return constant->get_all_data_elements_bitwise_identical(); @@ -357,7 +358,7 @@ bool NetworkHelper::isScalarLike(std::shared_ptr constant) { return !std::any_of(values.begin(), values.end(), [&](float value) { return values[0] != value; }); } -bool NetworkHelper::isZero(std::shared_ptr constant) { +bool NetworkHelper::isZero(std::shared_ptr constant) { static const float minQuantizationShift = 1e-32f; auto values = constant->cast_vector(); @@ -370,27 +371,27 @@ bool NetworkHelper::isZero(std::shared_ptr constant) { return true; } -std::shared_ptr NetworkHelper::toScalar(std::shared_ptr constant) { +std::shared_ptr NetworkHelper::toScalar(std::shared_ptr constant) { assert(isScalarLike(constant)); - return std::make_shared(constant->get_element_type(), Shape{}, constant->get_data_ptr()); + return std::make_shared(constant->get_element_type(), Shape{}, constant->get_data_ptr()); } std::shared_ptr NetworkHelper::getConstantInput(const std::shared_ptr& node, const bool convertIsExpected) { - std::shared_ptr parent = ov::as_type_ptr(node->input_value(0).get_node_shared_ptr()); + std::shared_ptr parent = ov::as_type_ptr(node->input_value(0).get_node_shared_ptr()); if (parent != nullptr) { return parent; } - parent = ov::as_type_ptr(node->input_value(1).get_node_shared_ptr()); + parent = ov::as_type_ptr(node->input_value(1).get_node_shared_ptr()); if (parent != nullptr) { return parent; } if (convertIsExpected) { auto getConstantBeforeConvert = [](const std::shared_ptr& node) -> std::shared_ptr { - std::shared_ptr parent = ov::as_type_ptr(node); + std::shared_ptr parent = ov::as_type_ptr(node); if (parent != nullptr) { - parent = ov::as_type_ptr(parent->input_value(0).get_node_shared_ptr()); + parent = ov::as_type_ptr(parent->input_value(0).get_node_shared_ptr()); if (parent != nullptr) { return parent; } @@ -442,8 +443,8 @@ std::vector NetworkHelper::updateReshapeValues( return std::move(updatedReshapeValues); } -std::shared_ptr NetworkHelper::optimizeMultipliesAfter(std::shared_ptr node) { - const auto multiply = ov::as_type_ptr(std::move(node)); +std::shared_ptr NetworkHelper::optimizeMultipliesAfter(std::shared_ptr node) { + const auto multiply = ov::as_type_ptr(std::move(node)); if (!multiply) { THROW_TRANSFORMATION_EXCEPTION << "Unexpected operation type in the optimizeMultipliesAfter method"; } @@ -455,7 +456,7 @@ std::shared_ptr NetworkHelper::optimizeMultipliesAfter } auto nextMultiplyInput = *multiply->output(0).get_target_inputs().begin(); - auto nextMultiply = ov::as_type_ptr>(nextMultiplyInput.get_node()->shared_from_this()); + auto nextMultiply = ov::as_type_ptr>(nextMultiplyInput.get_node()->shared_from_this()); if (nextMultiply) { auto constant2 = getConstantInput(nextMultiply); if (!constant2 || constant2->output(0).get_target_inputs().size() != 1) { @@ -463,10 +464,10 @@ std::shared_ptr NetworkHelper::optimizeMultipliesAfter } auto newInput = multiply->input_value(1 - constant1->output(0).get_target_inputs().begin()->get_index()); - auto multiplyResult = fold(constant1->output(0), constant2->output(0)); + auto multiplyResult = fold(constant1->output(0), constant2->output(0)); { // optimize constant shape: used in rfcn-resnet101-coco - const auto multiplyResultConstant = ov::as_type_ptr(multiplyResult); + const auto multiplyResultConstant = ov::as_type_ptr(multiplyResult); if ((multiplyResultConstant != nullptr) && NetworkHelper::isScalarLike(multiplyResultConstant)) { multiplyResult = NetworkHelper::toScalar(multiplyResultConstant); } @@ -475,7 +476,7 @@ std::shared_ptr NetworkHelper::optimizeMultipliesAfter auto inputPrecision1 = nextMultiply->get_origin_input_type(1); auto outputPrecision = nextMultiply->get_overridden_output_type(0); auto newMultiply = - std::make_shared>( + std::make_shared>( std::vector{ inputPrecision0, inputPrecision1 }, std::vector{ outputPrecision }, ov::op::TemporaryReplaceOutputType(newInput, inputPrecision0).get(), @@ -489,22 +490,22 @@ std::shared_ptr NetworkHelper::optimizeMultipliesAfter return nullptr; } -std::shared_ptr NetworkHelper::round(std::shared_ptr node, element::Type target_type) { - const auto constant = ov::as_type_ptr(node); +std::shared_ptr NetworkHelper::round(std::shared_ptr node, element::Type target_type) { + const auto constant = ov::as_type_ptr(node); assert(constant); - const auto castedConstant = ov::as_type_ptr(fold( - fold(constant->output(0), ngraph::op::v5::Round::RoundMode::HALF_AWAY_FROM_ZERO), + const auto castedConstant = ov::as_type_ptr(fold( + fold(constant->output(0), ov::op::v5::Round::RoundMode::HALF_AWAY_FROM_ZERO), target_type)); return castedConstant; } -std::shared_ptr NetworkHelper::fold_fake_quantize(const std::shared_ptr& fq) { +std::shared_ptr NetworkHelper::fold_fake_quantize(const std::shared_ptr& fq) { return foldFakeQuantize(fq, false, false); } -std::shared_ptr NetworkHelper::fold_fake_quantize(const std::shared_ptr& fq, +std::shared_ptr NetworkHelper::fold_fake_quantize(const std::shared_ptr& fq, const bool roundValues) { return foldFakeQuantize(fq, roundValues, true); } @@ -520,7 +521,7 @@ FakeQuantizeDequantization NetworkHelper::foldDequantization(const std::shared_p if (dequantization.convert != nullptr) { const std::shared_ptr result = foldConvert(dequantization.data, dequantization.convert->get_element_type()); - if (ov::is_type(result)) { + if (ov::is_type(result)) { if (inPlace) { copyInfo(dequantization.convert, result); } @@ -538,16 +539,16 @@ FakeQuantizeDequantization NetworkHelper::foldDequantization(const std::shared_p const auto convertionResult = foldConvert( dequantization.subtractConstant->output(0), dequantization.subtractConvert->get_element_type()); - if (ov::is_type(convertionResult)) { + if (ov::is_type(convertionResult)) { replace_node(dequantization.subtractConvert, convertionResult); dequantization = NetworkHelper::getDequantization(node, defaultPrecisions, branchIndex, inPlace); } } - const std::shared_ptr result = fold( + const std::shared_ptr result = fold( dequantization.subtract->input_value(0), dequantization.subtract->input_value(1)); - if (ov::is_type(result)) { + if (ov::is_type(result)) { if (inPlace) { copyInfo(dequantization.subtract, result); } @@ -563,10 +564,10 @@ FakeQuantizeDequantization NetworkHelper::foldDequantization(const std::shared_p return dequantization; } - std::shared_ptr result = fold( + std::shared_ptr result = fold( dequantization.multiply->input_value(0), dequantization.multiply->input_value(1)); - if (!ov::is_type(result)) { + if (!ov::is_type(result)) { return dequantization; } if (dequantization.multiply->get_output_element_type(0) != result->get_element_type()) { @@ -637,7 +638,7 @@ std::shared_ptr NetworkHelper::separateInStandaloneBranch(std::sha return node; } -std::shared_ptr NetworkHelper::fuseConvert(const std::shared_ptr& fakeQuantize) { +std::shared_ptr NetworkHelper::fuseConvert(const std::shared_ptr& fakeQuantize) { const Output output = fakeQuantize->output(0); const auto targetInputs = output.get_target_inputs(); if (targetInputs.size() != 1ul) { @@ -645,14 +646,14 @@ std::shared_ptr NetworkHelper::fuseConvert(const std::shar } Node* node = targetInputs.begin()->get_node(); - if (!ov::is_type(node) || + if (!ov::is_type(node) || // TODO: LPT: avoid precision hardcode: to separate method: isSupportedPrecision ((node->get_output_element_type(0) != element::u8) && (node->get_output_element_type(0) != element::i8))) { return fakeQuantize; } - std::shared_ptr newFakeQuantize = std::make_shared>( + std::shared_ptr newFakeQuantize = std::make_shared>( std::vector{ element::f32, element::f32, element::f32, element::f32, element::f32 }, std::vector{}, ov::op::TemporaryReplaceOutputType(fakeQuantize->input_value(0), element::f32).get(), @@ -708,7 +709,7 @@ size_t NetworkHelper::calculateLevels( } std::shared_ptr NetworkHelper::foldFakeQuantize( - const std::shared_ptr& fq, + const std::shared_ptr& fq, const bool roundValuesArg, const bool roundValuesWasSet) { // Corner case @@ -718,26 +719,26 @@ std::shared_ptr NetworkHelper::foldFakeQuantize( // outputHigh is const // outputLow == outputHigh // => y = Broadcast(Convert(outputLow, typeof(y))), ShapeOf(x)) - if (ov::is_type(fq->get_input_node_shared_ptr(3)) && - ov::is_type(fq->get_input_node_shared_ptr(4))) { + if (ov::is_type(fq->get_input_node_shared_ptr(3)) && + ov::is_type(fq->get_input_node_shared_ptr(4))) { const auto outputLowValues = - ov::as_type_ptr(fq->get_input_node_shared_ptr(3))->cast_vector(); + ov::as_type_ptr(fq->get_input_node_shared_ptr(3))->cast_vector(); const auto outputHighValues = - ov::as_type_ptr(fq->get_input_node_shared_ptr(4))->cast_vector(); + ov::as_type_ptr(fq->get_input_node_shared_ptr(4))->cast_vector(); if (outputLowValues == outputHighValues) { - const auto data_shape_node = fold(fq->input_value(0)); + const auto data_shape_node = fold(fq->input_value(0)); const auto cvt_output_low = foldConvert(fq->input_value(3), fq->get_output_element_type(0)); - return fold(cvt_output_low, data_shape_node); + return fold(cvt_output_low, data_shape_node); } } - if (ov::is_type(fq->get_input_node_shared_ptr(0))) { - std::shared_ptr subgraph = std::make_shared>(*fq, element::f32); + if (ov::is_type(fq->get_input_node_shared_ptr(0))) { + std::shared_ptr subgraph = std::make_shared>(*fq, element::f32); const auto& original_et = fq->get_output_element_type(0); const bool roundValues = roundValuesWasSet ? roundValuesArg : original_et.is_integral(); if (roundValues) { - subgraph = std::make_shared(subgraph, opset6::Round::RoundMode::HALF_TO_EVEN); + subgraph = std::make_shared(subgraph, ov::opset6::Round::RoundMode::HALF_TO_EVEN); } OPENVINO_SUPPRESS_DEPRECATED_START @@ -751,14 +752,14 @@ std::shared_ptr NetworkHelper::foldFakeQuantize( return fq; } -std::shared_ptr NetworkHelper::composeFakeQuantize(const std::shared_ptr& fakeQuantize, +std::shared_ptr NetworkHelper::composeFakeQuantize(const std::shared_ptr& fakeQuantize, const std::vector& defaultPrecisions) { std::shared_ptr parent = fakeQuantize; auto targetInputs = parent->output(0).get_target_inputs(); if (targetInputs.size() != 1ul) { return nullptr; } - if (ov::is_type(targetInputs.begin()->get_node())) { + if (ov::is_type(targetInputs.begin()->get_node())) { parent = targetInputs.begin()->get_node()->shared_from_this(); } @@ -766,7 +767,7 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s if (targetInputs.size() != 1ul) { return nullptr; } - if (ov::is_type(targetInputs.begin()->get_node())) { + if (ov::is_type(targetInputs.begin()->get_node())) { parent = targetInputs.begin()->get_node()->shared_from_this(); } @@ -774,7 +775,7 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s if (targetInputs.size() != 1ul) { return nullptr; } - if (ov::is_type(targetInputs.begin()->get_node())) { + if (ov::is_type(targetInputs.begin()->get_node())) { parent = targetInputs.begin()->get_node()->shared_from_this(); } @@ -787,10 +788,10 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s return nullptr; } - std::shared_ptr newFakeQuantize = fakeQuantize; + std::shared_ptr newFakeQuantize = fakeQuantize; if (dequantization.convert != nullptr) { - const std::shared_ptr replacement = std::make_shared>( + const std::shared_ptr replacement = std::make_shared>( newFakeQuantize->input_value(0), newFakeQuantize->input_value(1), newFakeQuantize->input_value(2), @@ -810,12 +811,12 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s dequantization.subtractConstant : foldConvert(dequantization.subtractConstant->output(0), dequantization.subtractConvert->get_destination_type()); - const std::shared_ptr replacement = std::make_shared>( + const std::shared_ptr replacement = std::make_shared>( newFakeQuantize->input_value(0), newFakeQuantize->input_value(1), newFakeQuantize->input_value(2), - fold(newFakeQuantize->input_value(3), subtractValue), - fold(newFakeQuantize->input_value(4), subtractValue), + fold(newFakeQuantize->input_value(3), subtractValue), + fold(newFakeQuantize->input_value(4), subtractValue), newFakeQuantize->get_levels(), newFakeQuantize->get_auto_broadcast()); replace_node(dequantization.subtract, replacement); @@ -833,7 +834,7 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s // 2) precision2 >= precision1 assert((precision2.is_real() == precision1.is_real()) && (precision2.bitwidth() >= precision1.bitwidth())); - auto output = fold( + auto output = fold( precision2 != precision1 ? foldConvert(value1, precision2) : value1, value2); @@ -844,7 +845,7 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s return output; }; - const std::shared_ptr replacement = std::make_shared>( + const std::shared_ptr replacement = std::make_shared>( newFakeQuantize->input_value(0ul), newFakeQuantize->input_value(1ul), newFakeQuantize->input_value(2ul), @@ -865,7 +866,7 @@ std::shared_ptr NetworkHelper::composeFakeQuantize(const s // Decompose FakeQuantize to FakeQuantize with output integer limits (quantize), dequatized MultiplyAdd // To align types the resulting sequence is FakeQuantize -> Convert -> Convert -> MultiplyAdd std::tuple, std::shared_ptr> NetworkHelper::decomposeFakeQuantize( - std::shared_ptr fq, + std::shared_ptr fq, const element::Type precision, const float min, const float max, @@ -876,8 +877,8 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos const auto outputLow = fq->input_value(3); const auto outputHigh = fq->input_value(4); - std::vector outputLowValues = ov::as_type_ptr(outputLow.get_node_shared_ptr())->cast_vector(); - std::vector outputHighValues = ov::as_type_ptr(outputHigh.get_node_shared_ptr())->cast_vector(); + std::vector outputLowValues = ov::as_type_ptr(outputLow.get_node_shared_ptr())->cast_vector(); + std::vector outputHighValues = ov::as_type_ptr(outputHigh.get_node_shared_ptr())->cast_vector(); size_t outputSize = outputLowValues.size(); std::vector minValues(outputSize, min); std::vector maxValues(outputSize, max); @@ -926,12 +927,12 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos } std::shared_ptr shift = hasZeroPoint ? - std::make_shared(deqPrecision, outputLow.get_shape(), shifts) : + std::make_shared(deqPrecision, outputLow.get_shape(), shifts) : nullptr; - std::shared_ptr scale = std::make_shared(element::f32, outputLow.get_shape(), scales); + std::shared_ptr scale = std::make_shared(element::f32, outputLow.get_shape(), scales); - auto newMin = std::make_shared(outputLow.get_element_type(), outputLow.get_shape(), minValues); - auto newMax = std::make_shared(outputLow.get_element_type(), outputLow.get_shape(), maxValues); + auto newMin = std::make_shared(outputLow.get_element_type(), outputLow.get_shape(), minValues); + auto newMax = std::make_shared(outputLow.get_element_type(), outputLow.get_shape(), maxValues); if (isScalarLike(newMin)) { newMin = toScalar(newMin); @@ -958,18 +959,18 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos } if (wasChanged) { - scale = std::make_shared(scale->output(0).get_element_type(), scale->output(0).get_shape(), scaleValues); + scale = std::make_shared(scale->output(0).get_element_type(), scale->output(0).get_shape(), scaleValues); } } - if ((shift != nullptr) && isZero(ov::as_type_ptr(shift))) { + if ((shift != nullptr) && isZero(ov::as_type_ptr(shift))) { shift = nullptr; } // Build a substitution sub-graph: std::shared_ptr newFQ = fold_fake_quantize( - std::make_shared>( + std::make_shared>( fq->input_value(0), getSingleConsumerConstant(fq->input_value(1)), getSingleConsumerConstant(fq->input_value(2)), @@ -983,23 +984,23 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos std::shared_ptr convert2; if (updatePrecision) { std::shared_ptr convert; - std::shared_ptr newFqConstant = ov::as_type_ptr(newFQ); + std::shared_ptr newFqConstant = ov::as_type_ptr(newFQ); - if (ov::is_type(newFQ)) { + if (ov::is_type(newFQ)) { convert = foldConvert(newFQ->output(0), precision); - } else if (ov::is_type(newFQ)) { - newFQ = setOutDataPrecision(ov::as_type_ptr(newFQ), precision); + } else if (ov::is_type(newFQ)) { + newFQ = setOutDataPrecision(ov::as_type_ptr(newFQ), precision); convert = newFQ; } else { THROW_IE_LPT_EXCEPTION(*newFQ) << "unexpected operation type"; } - convert2 = std::make_shared(convert, element::f32); + convert2 = std::make_shared(convert, element::f32); convert2->set_friendly_name(convert->get_friendly_name() + "/DequantizationConvert"); ngraph::copy_runtime_info({ newFQ, convert2 }, convert2); } else { if (newFQ->get_output_element_type(0) != element::f32) { - convert2 = std::make_shared(newFQ, element::f32); + convert2 = std::make_shared(newFQ, element::f32); convert2->set_friendly_name(newFQ->get_friendly_name() + "/DequantizationConvert"); ngraph::copy_runtime_info({ newFQ, convert2 }, convert2); } @@ -1008,14 +1009,14 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos // TODO: why type relaxed? const std::shared_ptr sub = shift == nullptr ? nullptr : - std::make_shared>(convert2 == nullptr ? newFQ : convert2, shift); + std::make_shared>(convert2 == nullptr ? newFQ : convert2, shift); if (sub != nullptr) { sub->set_friendly_name(newFQ->get_friendly_name() + "/DequantizationSubtract"); ngraph::copy_runtime_info({ newFQ, sub }, sub); } const auto dequantize = - std::make_shared>( + std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{ fq->get_output_element_type(0) }, ov::op::TemporaryReplaceOutputType(sub == nullptr ? (convert2 == nullptr ? newFQ : convert2) : sub, element::f32).get(), @@ -1028,18 +1029,18 @@ std::tuple, std::shared_ptr> NetworkHelper::decompos return std::make_tuple(newFQ, dequantize); } -std::shared_ptr NetworkHelper::updateFakeQuantize( - std::shared_ptr fq, +std::shared_ptr NetworkHelper::updateFakeQuantize( + std::shared_ptr fq, element::Type precision, float min, float max, const bool replace) { auto newInMin = getSingleConsumerConstant(fq->input_value(1)); auto newInMax = getSingleConsumerConstant(fq->input_value(2)); - auto newOutMin = std::make_shared(fq->get_output_element_type(0), Shape{}, min); - auto newOutMax = std::make_shared(fq->get_output_element_type(0), Shape{}, max); + auto newOutMin = std::make_shared(fq->get_output_element_type(0), Shape{}, min); + auto newOutMax = std::make_shared(fq->get_output_element_type(0), Shape{}, max); - std::shared_ptr newFQ = std::make_shared>( + std::shared_ptr newFQ = std::make_shared>( fq->input_value(0), newInMin, newInMax, @@ -1067,34 +1068,34 @@ FakeQuantizeDequantization NetworkHelper::makeDequantization( std::shared_ptr input) { if (input == nullptr) { // TODO: we create input here! we really need it here? - input = std::make_shared(precision, dataNodeOutputShape); + input = std::make_shared(precision, dataNodeOutputShape); } - std::shared_ptr parent = input; + std::shared_ptr parent = input; - std::shared_ptr convert; + std::shared_ptr convert; if (precision == deqPrecision) { convert = nullptr; } else { - convert = std::make_shared( + convert = std::make_shared( parent, deqPrecision); parent = convert; } - std::shared_ptr subtract; - std::shared_ptr subtractConstant; + std::shared_ptr subtract; + std::shared_ptr subtractConstant; if (std::abs(dequantizationSub) > 1e-6) { - subtract = std::make_shared>( + subtract = std::make_shared>( parent, - std::make_shared(deqPrecision, ngraph::Shape({}), std::vector({ dequantizationSub }))); + std::make_shared(deqPrecision, ngraph::Shape({}), std::vector({ dequantizationSub }))); subtract->set_output_type(0, deqPrecision, subtract->get_output_partial_shape(0)); parent = subtract; } // mandatory - auto multiplyConstant = std::make_shared(deqPrecision, ngraph::Shape({}), std::vector({ dequantizationMul })); - auto multiply = std::make_shared>( - opset1::Multiply(parent, multiplyConstant), + auto multiplyConstant = std::make_shared(deqPrecision, ngraph::Shape({}), std::vector({ dequantizationMul })); + auto multiply = std::make_shared>( + ov::opset1::Multiply(parent, multiplyConstant), originalPrecision); return FakeQuantizeDequantization(input, convert, subtract, nullptr, subtractConstant, multiply, multiplyConstant); @@ -1104,15 +1105,15 @@ std::shared_ptr NetworkHelper::makeDequantizationSubtract( const ov::Output& parent, const ov::Output& subtract_constant) { return subtract_constant.get_element_type() != parent.get_element_type() - ? std::dynamic_pointer_cast(std::make_shared( + ? std::dynamic_pointer_cast(std::make_shared( parent, - std::make_shared(subtract_constant, parent.get_element_type()))) - : std::make_shared(parent, subtract_constant); + std::make_shared(subtract_constant, parent.get_element_type()))) + : std::make_shared(parent, subtract_constant); } bool NetworkHelper::areQuantizeAndDequantizeSupportedForSubtract(const std::shared_ptr& node, const std::vector& defaultPrecisions) { - if (!ov::is_type(node)) { + if (!ov::is_type(node)) { return false; } @@ -1127,7 +1128,7 @@ bool NetworkHelper::areQuantizeAndDequantizeSupportedForSubtract(const std::shar bool NetworkHelper::areQuantizeAndDequantizeSupportedForMultiply(const std::shared_ptr& node, const std::vector& defaultPrecisions) { - if (!ov::is_type(node)) { + if (!ov::is_type(node)) { return false; } @@ -1138,21 +1139,21 @@ bool NetworkHelper::areQuantizeAndDequantizeSupportedForMultiply(const std::shar } const auto dataNode = dequantization.data.get_node(); - if (ov::is_type(dataNode)) { - const auto quantize = ov::as_type_ptr(dataNode->get_input_node_shared_ptr(0)); + if (ov::is_type(dataNode)) { + const auto quantize = ov::as_type_ptr(dataNode->get_input_node_shared_ptr(0)); if (quantize == nullptr) { return false; } return NetworkHelper::isQuantizeSupported(quantize); - } else if (ov::is_type(dataNode)) { + } else if (ov::is_type(dataNode)) { return true; } return false; } -bool NetworkHelper::isQuantizeSupported(const std::shared_ptr& fakeQuantize) { +bool NetworkHelper::isQuantizeSupported(const std::shared_ptr& fakeQuantize) { return QuantizationDetails::outputLayoutIsSupported(fakeQuantize) && QuantizationDetails::isSupportedLevel(fakeQuantize->get_levels()); } @@ -1161,15 +1162,17 @@ FakeQuantizeDequantization NetworkHelper::getDequantization(const std::shared_pt const size_t parentIndex, const bool inPlace) { auto getDataIndex = [](const std::shared_ptr& node) { - if (ov::is_type(node->get_input_node_ptr(1))) { + if (ov::is_type(node->get_input_node_ptr(1))) { return 0ul; } - if (ov::is_type(node->get_input_node_ptr(1)) && ov::is_type(node->get_input_node_ptr(1)->get_input_node_ptr(0))) { + if (ov::is_type(node->get_input_node_ptr(1)) && + ov::is_type(node->get_input_node_ptr(1)->get_input_node_ptr(0))) { return 0ul; } - if (ov::is_type(node->get_input_node_ptr(0)) && ov::is_type(node->get_input_node_ptr(0)->get_input_node_ptr(0))) { + if (ov::is_type(node->get_input_node_ptr(0)) && + ov::is_type(node->get_input_node_ptr(0)->get_input_node_ptr(0))) { return 1ul; } @@ -1185,8 +1188,8 @@ FakeQuantizeDequantization NetworkHelper::getDequantization(const std::shared_pt dataNode = node->input_value(parentIndex); } - const std::shared_ptr multiply = ov::as_type_ptr(dataNode.get_node_shared_ptr()); - std::shared_ptr multiplyConstant; + const std::shared_ptr multiply = ov::as_type_ptr(dataNode.get_node_shared_ptr()); + std::shared_ptr multiplyConstant; if (multiply != nullptr) { if (!FakeQuantizeDequantization::checkShape(multiply)) { return FakeQuantizeDequantization(); @@ -1199,9 +1202,9 @@ FakeQuantizeDequantization NetworkHelper::getDequantization(const std::shared_pt dataNode = multiply->get_input_source_output(getDataIndex(multiply)); } - const std::shared_ptr subtract = ov::as_type_ptr(dataNode.get_node_shared_ptr()); - std::shared_ptr subtractConvert; - std::shared_ptr subtractConstant; + const std::shared_ptr subtract = ov::as_type_ptr(dataNode.get_node_shared_ptr()); + std::shared_ptr subtractConvert; + std::shared_ptr subtractConstant; if (subtract != nullptr) { if (!FakeQuantizeDequantization::checkShape(subtract)) { return FakeQuantizeDequantization(dataNode, nullptr, nullptr, nullptr, nullptr, multiply, multiplyConstant); @@ -1214,7 +1217,7 @@ FakeQuantizeDequantization NetworkHelper::getDequantization(const std::shared_pt dataNode = subtract->get_input_source_output(getDataIndex(subtract)); } - const std::shared_ptr convert = ov::as_type_ptr(dataNode.get_node_shared_ptr()); + const std::shared_ptr convert = ov::as_type_ptr(dataNode.get_node_shared_ptr()); if (convert != nullptr) { auto el_type = convert->input(0).get_element_type(); auto foundIt = std::find(defaultPrecisions.begin(), defaultPrecisions.end(), el_type); @@ -1238,7 +1241,7 @@ FakeQuantizeDequantization NetworkHelper::getDequantizationBelow(const std::shar std::shared_ptr lastNode = targetInputs.begin()->get_node()->shared_from_this(); - const std::shared_ptr convert = ov::as_type_ptr(lastNode); + const std::shared_ptr convert = ov::as_type_ptr(lastNode); if (convertIsMandatory && (convert == nullptr)) { return FakeQuantizeDequantization(); } @@ -1256,9 +1259,9 @@ FakeQuantizeDequantization NetworkHelper::getDequantizationBelow(const std::shar lastNode = inputs.begin()->get_node()->shared_from_this(); } - const std::shared_ptr subtract = ov::as_type_ptr(lastNode); - std::shared_ptr subtractConvert; - std::shared_ptr subtractConstant; + const std::shared_ptr subtract = ov::as_type_ptr(lastNode); + std::shared_ptr subtractConvert; + std::shared_ptr subtractConstant; if (subtract != nullptr) { FakeQuantizeDequantization::fillDequantizationParams(subtract, subtractConvert, subtractConstant); if (subtractConstant == nullptr) { @@ -1272,8 +1275,8 @@ FakeQuantizeDequantization NetworkHelper::getDequantizationBelow(const std::shar lastNode = inputs.begin()->get_node()->shared_from_this(); } - const std::shared_ptr multiply = ov::as_type_ptr(lastNode); - std::shared_ptr multiplyConstant; + const std::shared_ptr multiply = ov::as_type_ptr(lastNode); + std::shared_ptr multiplyConstant; if (multiply != nullptr) { FakeQuantizeDequantization::fillDequantizationParams(multiply, multiplyConstant); if (multiplyConstant == nullptr) { @@ -1290,18 +1293,18 @@ FakeQuantizeDequantization NetworkHelper::normalizeDequantization(FakeQuantizeDe } // task: 79740 - if (dequantization.multiply != nullptr && ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(0))) { + if (dequantization.multiply != nullptr && ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(0))) { const auto leftParent = dequantization.multiply->input_value(0); const auto rightParent = dequantization.multiply->input_value(1); - std::shared_ptr normalized_multiply = ov::as_type_ptr( + std::shared_ptr normalized_multiply = ov::as_type_ptr( dequantization.multiply->clone_with_new_inputs({rightParent, leftParent})); replace_node(dequantization.multiply, normalized_multiply); dequantization.multiply = normalized_multiply; } - if (dequantization.subtract != nullptr && ov::as_type_ptr(dequantization.subtract->get_input_node_shared_ptr(0))) { + if (dequantization.subtract != nullptr && ov::as_type_ptr(dequantization.subtract->get_input_node_shared_ptr(0))) { const auto leftParent = dequantization.subtract->input_value(0); const auto rightParent = dequantization.subtract->input_value(1); - std::shared_ptr normalized_subtract = ov::as_type_ptr( + std::shared_ptr normalized_subtract = ov::as_type_ptr( dequantization.subtract->clone_with_new_inputs({rightParent, leftParent})); replace_node(dequantization.subtract, normalized_subtract); dequantization.subtract = normalized_subtract; @@ -1309,7 +1312,7 @@ FakeQuantizeDequantization NetworkHelper::normalizeDequantization(FakeQuantizeDe return dequantization; } -std::shared_ptr NetworkHelper::normalizeDequantizationShape( +std::shared_ptr NetworkHelper::normalizeDequantizationShape( const std::shared_ptr& eltwise, const bool convertIsExpected) { auto constantNode = getConstantInput(eltwise, convertIsExpected); @@ -1317,14 +1320,14 @@ std::shared_ptr NetworkHelper::normalizeDequantizationShape( return nullptr; } - auto constant = ov::as_type_ptr(constantNode); + auto constant = ov::as_type_ptr(constantNode); if (constant == nullptr) { return nullptr; } const auto getConstWithNormalizeShape = []( const std::shared_ptr& eltwise, - const std::shared_ptr& constant) { + const std::shared_ptr& constant) { const auto constantShape = constant->get_shape(); if (constantShape.empty()) { return constant; @@ -1335,11 +1338,11 @@ std::shared_ptr NetworkHelper::normalizeDequantizationShape( Shape unsqueezeConstantShape(eltwiseRank - constantShape.size()); std::iota(unsqueezeConstantShape.begin(), unsqueezeConstantShape.end(), 0ul); - const auto newConstant = fold( + const auto newConstant = fold( constant->output(0), - op::Constant::create(element::i32, Shape{ unsqueezeConstantShape.size() }, unsqueezeConstantShape)); + ov::opset1::Constant::create(element::i32, Shape{ unsqueezeConstantShape.size() }, unsqueezeConstantShape)); - return ov::as_type_ptr(newConstant); + return ov::as_type_ptr(newConstant); } else { return constant; } @@ -1357,19 +1360,19 @@ FakeQuantizeDequantizationValues NetworkHelper::createEmptyValues(const FakeQuan dequantization.multiplyConstant->get_element_type() != precision ? foldConvert(dequantization.multiplyConstant->output(0), precision) : dequantization.multiplyConstant : - std::make_shared(precision, Shape({}), std::vector({ 1.f })); + std::make_shared(precision, Shape({}), std::vector({ 1.f })); const std::shared_ptr subtractConstant = dequantization.subtract ? dequantization.subtractConstant->get_element_type() != precision ? foldConvert(dequantization.subtractConstant->output(0), precision) : dequantization.subtractConstant : - std::make_shared(precision, Shape({}), std::vector({ 0.f })); + std::make_shared(precision, Shape({}), std::vector({ 0.f })); return FakeQuantizeDequantizationValues(subtractConstant, multiplyConstant); } bool NetworkHelper::isZeroConst(const std::shared_ptr& node) { - std::shared_ptr constant = ov::as_type_ptr(node); + std::shared_ptr constant = ov::as_type_ptr(node); if (constant == nullptr) return false; @@ -1386,15 +1389,15 @@ bool NetworkHelper::isZeroConst(const std::shared_ptr& node) { } } -std::shared_ptr NetworkHelper::optimizeSubtract(std::shared_ptr subtract) { +std::shared_ptr NetworkHelper::optimizeSubtract(std::shared_ptr subtract) { auto convertOnSubtract = subtract->input_value(0).get_node_shared_ptr(); - if (ov::as_type_ptr(convertOnSubtract) == nullptr) { + if (ov::as_type_ptr(convertOnSubtract) == nullptr) { return subtract; } // TODO: replace assert to condition and omit conversion part if there is no convert // TODO: also check convertInputType to understand if we really want to propagate type - assert(ov::as_type_ptr(convertOnSubtract)); + assert(ov::as_type_ptr(convertOnSubtract)); const element::Type convertInputType = convertOnSubtract->get_input_element_type(0); const element::Type convertOutputType = convertOnSubtract->get_output_element_type(0); @@ -1405,17 +1408,17 @@ std::shared_ptr NetworkHelper::optimizeSubtract(std::shared_ptrinput_value(0); // check if shift is a constant std::shared_ptr shift = subtract->get_input_node_shared_ptr(1); - bool isShiftConstant = ov::is_type(shift); - if (!isShiftConstant && ov::is_type(shift)) { + bool isShiftConstant = ov::is_type(shift); + if (!isShiftConstant && ov::is_type(shift)) { // if not - we're dealing with shift->Convert (to high precision) -> Subtract shift = shift->get_input_node_shared_ptr(0); - isShiftConstant = ov::is_type(shift); + isShiftConstant = ov::is_type(shift); } if (isShiftConstant) { std::shared_ptr replacement; - auto shiftConst = ov::as_type_ptr(shift); - std::shared_ptr roundedShift; + auto shiftConst = ov::as_type_ptr(shift); + std::shared_ptr roundedShift; if (shiftConst->get_element_type() != convertInputType) { roundedShift = NetworkHelper::round(shiftConst, convertInputType); } else { @@ -1434,7 +1437,7 @@ std::shared_ptr NetworkHelper::optimizeSubtract(std::shared_ptr>(data, roundedShift->output(0)); + replacement = std::make_shared>(data, roundedShift->output(0)); NetworkHelper::copyInfo(subtract, replacement); NetworkHelper::setOutDataPrecisionForTypeRelaxed(replacement, convertOutputType); replace_node(subtract, replacement); @@ -1488,7 +1491,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter const bool shouldConvert = (newOperation->get_output_element_type(0) != deqPrecision); if (shouldConvert) { const auto convertOutputPrecision = dequantization.convert ? dequantization.convert->get_element_type() : deqPrecision; - parent = std::make_shared(parent, convertOutputPrecision); + parent = std::make_shared(parent, convertOutputPrecision); ngraph::copy_runtime_info({ newOperation, parent }, parent); } @@ -1502,7 +1505,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter dequantization.subtractConstant->get_element_type(); } - parent = std::make_shared>( + parent = std::make_shared>( element::TypeVector{ element::f32, element::f32 }, element::TypeVector{ element::f32 }, ov::op::TemporaryReplaceOutputType(parent, element::f32).get(), ov::op::TemporaryReplaceOutputType(foldConvert(dequantization.subtractConstant, parentPrecision), element::f32).get()); @@ -1511,7 +1514,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter // Subtract constant could be changed (including a shape) before propagation in some cases // so it's necessary to compute the shape for a subtractConvert before creating a new subtract dequantization.subtractConvert->validate_and_infer_types(); - parent = std::make_shared(parent, dequantization.subtractConvert); + parent = std::make_shared(parent, dequantization.subtractConvert); ngraph::copy_runtime_info({ newOperation, parent }, parent); } } @@ -1525,8 +1528,8 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter dequantization.multiplyConstant->get_element_type(); } - parent = std::make_shared>( - opset1::Multiply(parent, foldConvert(dequantization.multiplyConstant, parentPrecision)), + parent = std::make_shared>( + ov::opset1::Multiply(parent, foldConvert(dequantization.multiplyConstant, parentPrecision)), dequantization.multiply->get_output_element_type(0)); ngraph::copy_runtime_info({ newOperation, parent }, parent); } @@ -1553,9 +1556,9 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor assert( (NetworkHelper::getDequantizationBelow(operation).multiplyConstant == nullptr) || (NetworkHelper::getDequantizationBelow(operation).multiplyConstant.get() == dequantization.multiplyConstant.get())); - std::vector>> multiplyConstants, subtractConstants; - if (is_type(operation)) { - const auto concatNode = as_type_ptr(operation); + std::vector>> multiplyConstants, subtractConstants; + if (is_type(operation)) { + const auto concatNode = as_type_ptr(operation); auto axis = concatNode->get_concatenation_axis(); if (dequantization.multiply && dequantization.multiplyConstant->get_shape().size() > 1 && dequantization.multiplyConstant->get_shape()[axis] != 1) { multiplyConstants = NetworkHelper::splitConstantsBeforeConcat(operation, { dequantization.multiplyConstant }); @@ -1576,7 +1579,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor const auto convertOutputPrecision = dequantization.convert != nullptr ? dequantization.convert->get_output_element_type(0) : deqPrecision; - parent = std::make_shared(parent, convertOutputPrecision); + parent = std::make_shared(parent, convertOutputPrecision); if (dequantization.convert == nullptr) { THROW_TRANSFORMATION_EXCEPTION << "dequantization convert is absent"; } @@ -1594,7 +1597,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor dequantization.subtractConstant->get_element_type(); } auto subtractConstant = subtractConstants.size() ? subtractConstants[0][i] : dequantization.subtractConstant; - parent = std::make_shared>( + parent = std::make_shared>( std::vector{element::f32, element::f32}, std::vector{ element::f32 }, ov::op::TemporaryReplaceOutputType(parent, element::f32).get(), ov::op::TemporaryReplaceOutputType( @@ -1606,7 +1609,7 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor // Subtract constant could be changed (including a shape) before propagation in some cases // so it's necessary to compute the shape for a subtractConvert before creating a new subtract dequantization.subtractConvert->validate_and_infer_types(); - parent = std::make_shared(parent, dequantization.subtractConvert); + parent = std::make_shared(parent, dequantization.subtractConvert); } ngraph::copy_runtime_info(dequantization.subtract, parent); } @@ -1620,8 +1623,8 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor ", multiply dequantization constant " << multiplyConstant->get_friendly_name() << ":" << multiplyConstant->get_element_type(); } - parent = std::make_shared>( - opset1::Multiply(parent, + parent = std::make_shared>( + ov::opset1::Multiply(parent, multiplyConstant->output(0).get_element_type() == parentPrecision ? multiplyConstant : foldConvert(multiplyConstant->output(0), parentPrecision)), @@ -1652,11 +1655,11 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor return InsertDequantizationResult(newOperation, dequantization.multiply); } -std::vector>> NetworkHelper::splitConstantsBeforeConcat(const std::shared_ptr concat, - const std::vector> currConstants) { - std::vector>> newConstants(currConstants.size()); +std::vector>> NetworkHelper::splitConstantsBeforeConcat(const std::shared_ptr concat, + const std::vector> currConstants) { + std::vector>> newConstants(currConstants.size()); auto number_of_concat_inputs = concat->get_input_size(); - const auto concatNode = as_type_ptr(concat); + const auto concatNode = as_type_ptr(concat); const auto concat_axis = concatNode->get_concatenation_axis(); std::vector shape_axis(number_of_concat_inputs); for (size_t i{ 0 }; i < number_of_concat_inputs; ++i) { @@ -1664,16 +1667,16 @@ std::vector>> NetworkHelpe shape_axis[i] = shape[concat_axis].get_length(); } for (size_t i = 0; i < currConstants.size(); ++i) { - std::vector> newConstant; + std::vector> newConstant; const auto const_shape = currConstants[i]->get_shape(); if (ov::shape_size(const_shape) == 1 || const_shape[concat_axis] == 1) { newConstant.push_back(currConstants[i]); newConstants[i] = newConstant; continue; } - auto split = std::make_shared(currConstants[i], - opset1::Constant::create(element::i64, Shape{}, { concat_axis }), - opset1::Constant::create(element::i64, Shape{ number_of_concat_inputs }, shape_axis)); + auto split = std::make_shared(currConstants[i], + ov::opset1::Constant::create(element::i64, Shape{}, { concat_axis }), + ov::opset1::Constant::create(element::i64, Shape{ number_of_concat_inputs }, shape_axis)); OutputVector outputResults(split->get_output_size()); auto foldResult = split->constant_fold(outputResults, split->input_values()); if (!foldResult) { @@ -1681,7 +1684,7 @@ std::vector>> NetworkHelpe concat->get_friendly_name(); } for (auto outputResult : outputResults) { - auto constant = as_type_ptr(outputResult.get_node_shared_ptr()); + auto constant = as_type_ptr(outputResult.get_node_shared_ptr()); newConstant.push_back(constant); } @@ -1695,7 +1698,7 @@ bool NetworkHelper::checkConstantValuePrecision(const element::Type expectedPrec return true; } - std::shared_ptr constantOp = ov::as_type_ptr(constant); + std::shared_ptr constantOp = ov::as_type_ptr(constant); if (constantOp == nullptr) { return false; } @@ -1730,7 +1733,7 @@ size_t NetworkHelper::getParentOutputIndex(const std::shared_ptr& } std::shared_ptr NetworkHelper::toScalarIfPossible(std::shared_ptr node) { - std::shared_ptr constant = ov::as_type_ptr(node); + std::shared_ptr constant = ov::as_type_ptr(node); if (constant == nullptr) { return node; } @@ -1743,11 +1746,11 @@ std::shared_ptr NetworkHelper::toScalarIfPossible(std::shared_ptr no } std::shared_ptr foldConvert(const Output& node, const element::Type targetPrecision) { - if (ov::is_type(node.get_node_shared_ptr()) && (node.get_element_type() == targetPrecision)) { + if (ov::is_type(node.get_node_shared_ptr()) && (node.get_element_type() == targetPrecision)) { return node.get_node_shared_ptr(); } - return fold(node, targetPrecision); + return fold(node, targetPrecision); } bool NetworkHelper::checkZeroPoint(const std::shared_ptr& node, const DataPrecision& dataPrecision) { @@ -1756,9 +1759,9 @@ bool NetworkHelper::checkZeroPoint(const std::shared_ptr& node, const Data } float min, max; - if (ov::is_type(node)) { + if (ov::is_type(node)) { const auto parent = node->get_input_node_shared_ptr(0); - const auto intNode = ov::is_type(parent) ? parent : node; + const auto intNode = ov::is_type(parent) ? parent : node; const auto type = intNode->get_input_element_type(0); if (type == element::u8 || type == element::i8) { min = DataPrecision::getMinValue(type, levels::int8) - 0.5f; @@ -1767,12 +1770,12 @@ bool NetworkHelper::checkZeroPoint(const std::shared_ptr& node, const Data return type == element::f32 || type == element::f16; } auto subtract1input = node->get_input_node_shared_ptr(1); - if (ov::is_type(subtract1input)) { + if (ov::is_type(subtract1input)) { return true; } - auto subtractConst = ov::as_type_ptr(subtract1input); + auto subtractConst = ov::as_type_ptr(subtract1input); if (!subtractConst) { - subtractConst = ov::as_type_ptr(node->get_input_node_shared_ptr(1)->get_input_node_shared_ptr(0)); + subtractConst = ov::as_type_ptr(node->get_input_node_shared_ptr(1)->get_input_node_shared_ptr(0)); if (subtractConst == nullptr) { return false; } @@ -1782,13 +1785,13 @@ bool NetworkHelper::checkZeroPoint(const std::shared_ptr& node, const Data return (val < min) || (val > max); })) { return false; } - } else if (ov::is_type(node)) { + } else if (ov::is_type(node)) { if (!dataPrecision.hasZeroPoint) { return true; } min = dataPrecision.min - 0.5f; max = dataPrecision.max + 0.5f; - const auto quantizationDetails = QuantizationDetails::getDetails(ov::as_type_ptr(node)); + const auto quantizationDetails = QuantizationDetails::getDetails(ov::as_type_ptr(node)); for (size_t i = 0; i < quantizationDetails.outputLowValues.size(); ++i) { float shift; if (quantizationDetails.outputHighValues[i] != quantizationDetails.outputLowValues[i]) { @@ -1846,7 +1849,7 @@ void NetworkHelper::insertDequantizationAfter( // We do it to avoid dequantization propagation to the shapeOf subgraphs for (const auto& input : dequantization->get_output_target_inputs(0)) { - if (const auto shapeOf = as_type_ptr(input.get_node()->shared_from_this())) { + if (const auto shapeOf = as_type_ptr(input.get_node()->shared_from_this())) { const auto newShapeOf = shapeOf->clone_with_new_inputs({ newNode }); replace_node_update_name(shapeOf, newShapeOf); } @@ -1855,7 +1858,7 @@ void NetworkHelper::insertDequantizationAfter( ov::Output NetworkHelper::getSingleConsumerConstant(const ov::Output& output) { const auto node = output.get_node(); - if (!ngraph::is_type(node)) + if (!ngraph::is_type(node)) THROW_IE_LPT_EXCEPTION(*node) << "getSingleConsumerConstant Expected Constant node type"; return output.get_target_inputs().size() == 1 ? output @@ -1863,7 +1866,7 @@ ov::Output NetworkHelper::getSingleConsumerConstant(const ov::Output constant_node) { - const auto constant = ov::as_type_ptr(constant_node); + const auto constant = ov::as_type_ptr(constant_node); if (constant == nullptr) return false; const auto values = constant->cast_vector(); diff --git a/src/common/low_precision_transformations/src/normalize_l2.cpp b/src/common/low_precision_transformations/src/normalize_l2.cpp index b97e7edcf87..92385983ae0 100644 --- a/src/common/low_precision_transformations/src/normalize_l2.cpp +++ b/src/common/low_precision_transformations/src/normalize_l2.cpp @@ -23,7 +23,7 @@ using namespace ngraph::pass::low_precision; namespace normalize_l2 { template -std::shared_ptr createNewScalesConst(const ngraph::op::Constant& originalConst) { +std::shared_ptr createNewScalesConst(const ov::opset1::Constant& originalConst) { std::vector source = originalConst.cast_vector(); std::vector newData(source.size()); @@ -32,16 +32,16 @@ std::shared_ptr createNewScalesConst(const ngraph::op::Con } const ngraph::element::Type type = originalConst.get_output_element_type(0); - return ngraph::op::Constant::create(type, originalConst.get_shape(), newData); + return ov::opset1::Constant::create(type, originalConst.get_shape(), newData); } } // namespace normalize_l2 NormalizeL2Transformation::NormalizeL2Transformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(NormalizeL2Transformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -69,7 +69,7 @@ bool NormalizeL2Transformation::canBeTransformed(const TransformationContext& co } // TODO: Expand transformation for all cases of axes values - const auto axes = ov::as_type_ptr(operation->get_input_node_shared_ptr(1)); + const auto axes = ov::as_type_ptr(operation->get_input_node_shared_ptr(1)); const std::vector axesAcrossSpatial = { 1 }; const std::vector axesByChannels = { 1, 2, 3 }; @@ -102,16 +102,16 @@ bool NormalizeL2Transformation::transform(TransformationContext &context, ngraph return false; } - auto normalize = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(operation, defaultPrecisions)); + auto normalize = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(operation, defaultPrecisions)); - const auto axes = ov::as_type_ptr(normalize->get_input_node_shared_ptr(1)); + const auto axes = ov::as_type_ptr(normalize->get_input_node_shared_ptr(1)); FakeQuantizeDequantization dequantization = NetworkHelper::getDequantization(normalize, defaultPrecisions); - auto scalesConst = ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(1)); + auto scalesConst = ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(1)); if (scalesConst == nullptr) { - scalesConst = ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(0)); + scalesConst = ov::as_type_ptr(dequantization.multiply->get_input_node_shared_ptr(0)); } - std::shared_ptr newScalesConst; + std::shared_ptr newScalesConst; const auto type = scalesConst->get_output_element_type(0); switch (type) { case ngraph::element::Type_t::f16: { @@ -127,7 +127,7 @@ bool NormalizeL2Transformation::transform(TransformationContext &context, ngraph } } - auto newNormalize = std::make_shared>( + auto newNormalize = std::make_shared>( std::vector{ element::f32, axes->output(0).get_element_type() }, std::vector{deqPrecision}, ov::op::TemporaryReplaceOutputType(dequantization.subtract == nullptr ? dequantization.data : dequantization.subtract, element::f32).get(), @@ -136,14 +136,14 @@ bool NormalizeL2Transformation::transform(TransformationContext &context, ngraph normalize->get_eps_mode()); NetworkHelper::copyInfo(normalize, newNormalize); - auto newMultiply = std::make_shared>( + auto newMultiply = std::make_shared>( std::vector{ element::f32, element::f32 }, std::vector{normalize->get_output_element_type(0)}, ov::op::TemporaryReplaceOutputType(newNormalize, element::f32).get(), ov::op::TemporaryReplaceOutputType(newScalesConst, element::f32).get()); NetworkHelper::insertDequantizationAfter(normalize, newMultiply, newNormalize); - ngraph::copy_runtime_info({ normalize, newMultiply }, newMultiply); + ov::copy_runtime_info({ normalize, newMultiply }, newMultiply); updateOutput(context, newMultiply, newNormalize); return true; diff --git a/src/common/low_precision_transformations/src/pad.cpp b/src/common/low_precision_transformations/src/pad.cpp index 933a6ac0fdf..16409fa7cf8 100644 --- a/src/common/low_precision_transformations/src/pad.cpp +++ b/src/common/low_precision_transformations/src/pad.cpp @@ -17,11 +17,11 @@ namespace low_precision { PadTransformation::PadTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(PadTransformation); - auto mul = pattern::wrap_type(); - auto padsBegin = pattern::wrap_type(); - auto padsEnd = pattern::wrap_type(); - auto padsValue = pattern::wrap_type(); - auto matcher = pattern::wrap_type({ mul, padsBegin, padsEnd, padsValue }); + auto mul = pattern::wrap_type(); + auto padsBegin = pattern::wrap_type(); + auto padsEnd = pattern::wrap_type(); + auto padsValue = pattern::wrap_type(); + auto matcher = pattern::wrap_type({ mul, padsBegin, padsEnd, padsValue }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -40,8 +40,8 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter return false; } - const auto pad = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions)); - const auto padConstant = ov::as_type_ptr(pad->get_input_node_shared_ptr(3)); + const auto pad = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions)); + const auto padConstant = ov::as_type_ptr(pad->get_input_node_shared_ptr(3)); const auto padConstantValue = padConstant->cast_vector()[0]; const auto padsBegin = pad->get_pads_begin(); @@ -51,7 +51,7 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter auto dequantization = NetworkHelper::getDequantization(pad, defaultPrecisions); if (padMode == op::PadMode::CONSTANT) { - auto bcastConstant = [&](const std::shared_ptr &constant) { + auto bcastConstant = [&](const std::shared_ptr &constant) { size_t padIdx = 0; for (size_t i = 0; i < padsBegin.size(); ++i) { if (padsBegin[i] != 0 || padsEnd[i] != 0) { @@ -66,8 +66,8 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter auto bcastedShape = Shape(inputPShape.rank().get_length(), 1ul); bcastedShape[padIdx] = inputPShape[padIdx].get_length(); - const auto bCastConst = opset1::Constant::create(element::i32, Shape{bcastedShape.size()}, bcastedShape); - return ov::as_type_ptr(fold(constant, bCastConst)); + const auto bCastConst = ov::opset1::Constant::create(element::i32, Shape{bcastedShape.size()}, bcastedShape); + return ov::as_type_ptr(fold(constant, bCastConst)); }; if (dequantization.subtract && shape_size(dequantization.subtractConstant->get_shape()) == 1ul) { @@ -84,8 +84,8 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter } auto foldConstantIfNecessary = [&padMode, &padsBegin, &padsEnd]( - const std::shared_ptr& constant, - const std::shared_ptr& pad, + const std::shared_ptr& constant, + const std::shared_ptr& pad, float padVal) { const auto constantShape = constant->get_shape(); if (shape_size(constantShape) == 1ul) { @@ -110,11 +110,11 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter } if (foldingIsNecessary) { - const auto beginConst = opset1::Constant::create(element::u32, { padsForConstantBegin.size() }, padsForConstantBegin); - const auto endConst = opset1::Constant::create(element::u32, { padsForConstantEnd.size() }, padsForConstantEnd); - const auto padValueConstant = opset1::Constant::create(constant->get_element_type(), Shape{}, { padVal }); - const auto foldedConstant = fold(constant, beginConst, endConst, padValueConstant, padMode); - return ov::as_type_ptr(foldedConstant); + const auto beginConst = ov::opset1::Constant::create(element::u32, { padsForConstantBegin.size() }, padsForConstantBegin); + const auto endConst = ov::opset1::Constant::create(element::u32, { padsForConstantEnd.size() }, padsForConstantEnd); + const auto padValueConstant = ov::opset1::Constant::create(constant->get_element_type(), Shape{}, { padVal }); + const auto foldedConstant = fold(constant, beginConst, endConst, padValueConstant, padMode); + return ov::as_type_ptr(foldedConstant); } else { return constant; } @@ -145,7 +145,7 @@ bool PadTransformation::transform(TransformationContext& context, ngraph::patter } // we must convert pad value in low precision - const auto convertedZero = opset1::Constant::create(dequantization.data.get_element_type(), Shape{}, { padConstantValue }); + const auto convertedZero = ov::opset1::Constant::create(dequantization.data.get_element_type(), Shape{}, { padConstantValue }); pad->set_argument(3, convertedZero); moveDequantizationAfter(context, pad, dequantization, true); @@ -157,7 +157,7 @@ bool PadTransformation::canBeTransformed(const TransformationContext& context, s return false; } - const auto pad = ov::as_type_ptr(op); + const auto pad = ov::as_type_ptr(op); if (!pad) { return false; } @@ -169,7 +169,7 @@ bool PadTransformation::canBeTransformed(const TransformationContext& context, s const auto mode = pad->get_pad_mode(); if (mode == op::PadMode::CONSTANT) { - auto padAndDqByTheSameDimension = [&](const std::shared_ptr& deqConst) { + auto padAndDqByTheSameDimension = [&](const std::shared_ptr& deqConst) { const auto padsBegin = pad->get_pads_begin(); const auto padsEnd = pad->get_pads_end(); @@ -231,7 +231,7 @@ bool PadTransformation::canBeTransformed(const TransformationContext& context, s return false; } - const auto constant = ov::as_type_ptr(pad->get_input_node_shared_ptr(3)); + const auto constant = ov::as_type_ptr(pad->get_input_node_shared_ptr(3)); const auto constantValue = constant->cast_vector()[0]; if (constantValue != 0.f && !padAndDqByTheSameDimension(dequantization.multiplyConstant)) { return false; diff --git a/src/common/low_precision_transformations/src/prelu.cpp b/src/common/low_precision_transformations/src/prelu.cpp index 55e3f082e9c..ba1d94f53df 100644 --- a/src/common/low_precision_transformations/src/prelu.cpp +++ b/src/common/low_precision_transformations/src/prelu.cpp @@ -20,7 +20,7 @@ namespace low_precision { PReluTransformation::PReluTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(PReluTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); diff --git a/src/common/low_precision_transformations/src/propagate_precisions.cpp b/src/common/low_precision_transformations/src/propagate_precisions.cpp index dc22bfb66af..3ea044135f5 100644 --- a/src/common/low_precision_transformations/src/propagate_precisions.cpp +++ b/src/common/low_precision_transformations/src/propagate_precisions.cpp @@ -12,6 +12,7 @@ #include "low_precision/propagate_through_precision_preserved.hpp" #include "low_precision/propagate_to_input.hpp" #include "itt.hpp" +#include "openvino/pass/manager.hpp" using namespace ngraph; using namespace ngraph::pass::low_precision; @@ -20,7 +21,7 @@ ngraph::pass::low_precision::PropagatePrecisions::PropagatePrecisions(const Attr bool ngraph::pass::low_precision::PropagatePrecisions::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(PropagatePrecisions); - ngraph::pass::Manager manager; + ov::pass::Manager manager; manager.set_per_pass_validation(false); std::shared_ptr precisionsPropagation = manager.register_pass(); precisionsPropagation->add_matcher>(params, AttributeSource::OutputPort); diff --git a/src/common/low_precision_transformations/src/pull_reshape_through_dequantization.cpp b/src/common/low_precision_transformations/src/pull_reshape_through_dequantization.cpp index 24e0087d2a4..941eb8415cc 100644 --- a/src/common/low_precision_transformations/src/pull_reshape_through_dequantization.cpp +++ b/src/common/low_precision_transformations/src/pull_reshape_through_dequantization.cpp @@ -86,7 +86,7 @@ std::shared_ptr moveThroughElementwise(const std::shared_ptr& reshap std::make_shared(newElementwiseValues, elementwiseValuesConvert->get_destination_type()) }); replace_node(reshape, newElementwise); - copy_runtime_info({ elementwise, reshape }, { newReshape, newElementwise }); + ov::copy_runtime_info({ elementwise, reshape }, { newReshape, newElementwise }); return newReshape; } @@ -94,7 +94,7 @@ std::shared_ptr moveThroughConvert(const std::shared_ptr& reshape, c const auto newReshape = reshape->clone_with_new_inputs({ convert->input_value(0), reshape->input_value(1) }); const auto newConvert = convert->clone_with_new_inputs({ newReshape }); replace_node(reshape, newConvert); - copy_runtime_info({ convert, reshape }, { newReshape, newConvert }); + ov::copy_runtime_info({ convert, reshape }, { newReshape, newConvert }); return newReshape; } diff --git a/src/common/low_precision_transformations/src/pull_transpose_through_dequantization.cpp b/src/common/low_precision_transformations/src/pull_transpose_through_dequantization.cpp index af921c2b970..6aca9adba7f 100644 --- a/src/common/low_precision_transformations/src/pull_transpose_through_dequantization.cpp +++ b/src/common/low_precision_transformations/src/pull_transpose_through_dequantization.cpp @@ -62,7 +62,7 @@ std::shared_ptr moveThroughElementwise(const std::shared_ptr& transp std::make_shared(newElementwiseValues, elementwiseValuesConvert->get_destination_type()) }); replace_node(transpose, newElementwise); - copy_runtime_info({ elementwise, transpose }, { newTranspose, newElementwise }); + ov::copy_runtime_info({ elementwise, transpose }, { newTranspose, newElementwise }); return newTranspose; } @@ -71,7 +71,7 @@ std::shared_ptr moveThroughConvert(const std::shared_ptr& transpose, const auto newTranspose = transpose->clone_with_new_inputs({convert->input_value(0), transpose->input_value(1) }); const auto newConvert = convert->clone_with_new_inputs({ newTranspose }); replace_node(transpose, newConvert); - copy_runtime_info({ convert, transpose }, { newTranspose, newConvert }); + ov::copy_runtime_info({ convert, transpose }, { newTranspose, newConvert }); return newTranspose; } diff --git a/src/common/low_precision_transformations/src/quantization_details.cpp b/src/common/low_precision_transformations/src/quantization_details.cpp index a72b7ad3a46..a4eda13eb95 100644 --- a/src/common/low_precision_transformations/src/quantization_details.cpp +++ b/src/common/low_precision_transformations/src/quantization_details.cpp @@ -49,13 +49,13 @@ QuantizationDetails::QuantizationDetails(const size_t levels, const std::vector< outputLowValues(outputLowValues), outputHighValues(outputHighValues) {} -bool QuantizationDetails::outputLayoutIsSupported(std::shared_ptr quantize, bool isConvertExpected) { +bool QuantizationDetails::outputLayoutIsSupported(std::shared_ptr quantize, bool isConvertExpected) { const auto inputs = quantize->inputs(); for (size_t i = 1; i < inputs.size(); ++i) { const auto node = inputs[i].get_source_output().get_node_shared_ptr(); - bool supported = ov::is_type(node); + bool supported = ov::is_type(node); if (!supported && isConvertExpected) { - supported = ov::is_type(node) && ov::is_type(node->get_input_node_ptr(0)); + supported = ov::is_type(node) && ov::is_type(node->get_input_node_ptr(0)); } if (!supported) { return false; @@ -65,14 +65,14 @@ bool QuantizationDetails::outputLayoutIsSupported(std::shared_ptr quantize, + std::shared_ptr quantize, std::vector& inputLowValues, std::vector& inputHighValues) { - std::shared_ptr inputLowLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(1)); + std::shared_ptr inputLowLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(1)); const std::vector& inputLowBlobValues = getBlobValue(inputLowLayer); inputLowValues.insert(inputLowValues.end(), inputLowBlobValues.begin(), inputLowBlobValues.end()); - std::shared_ptr inputHighLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(2)); + std::shared_ptr inputHighLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(2)); const std::vector inputHighBlobValues = getBlobValue(inputHighLayer); inputHighValues.insert(inputHighValues.end(), inputHighBlobValues.begin(), inputHighBlobValues.end()); @@ -83,14 +83,14 @@ void QuantizationDetails::getInputIntervals( void QuantizationDetails::getOutputIntervals( - std::shared_ptr quantize, + std::shared_ptr quantize, std::vector& outputLowValues, std::vector& outputHighValues) { - std::shared_ptr outputLowLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(3)); + std::shared_ptr outputLowLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(3)); const std::vector& outputLowBlobValues = getBlobValue(outputLowLayer); outputLowValues.insert(outputLowValues.end(), outputLowBlobValues.begin(), outputLowBlobValues.end()); - std::shared_ptr outputHighLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(4)); + std::shared_ptr outputHighLayer = ov::as_type_ptr(quantize->get_input_node_shared_ptr(4)); const std::vector outputHighBlobValues = getBlobValue(outputHighLayer); outputHighValues.insert(outputHighValues.end(), outputHighBlobValues.begin(), outputHighBlobValues.end()); @@ -99,16 +99,16 @@ void QuantizationDetails::getOutputIntervals( } } -QuantizationDetails QuantizationDetails::getDetails(std::shared_ptr quantize) { +QuantizationDetails QuantizationDetails::getDetails(std::shared_ptr quantize) { if (!QuantizationDetails::outputLayoutIsSupported(quantize)) { return QuantizationDetails(); } - const std::vector inputLowValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(1))->cast_vector(); - const std::vector inputHighValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(2))->cast_vector(); + const std::vector inputLowValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(1))->cast_vector(); + const std::vector inputHighValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(2))->cast_vector(); - const std::vector outputLowValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(3))->cast_vector(); - const std::vector outputHighValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(4))->cast_vector(); + const std::vector outputLowValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(3))->cast_vector(); + const std::vector outputHighValues = ov::as_type_ptr(quantize->get_input_node_shared_ptr(4))->cast_vector(); return QuantizationDetails( quantize->get_levels(), @@ -163,7 +163,7 @@ float QuantizationDetails::getOutputHighValue(const size_t index) const { } std::vector QuantizationDetails::getBlobValue(std::shared_ptr constantLayer) { - return ov::as_type_ptr(constantLayer)->cast_vector(); + return ov::as_type_ptr(constantLayer)->cast_vector(); } bool QuantizationDetails::empty() const noexcept { diff --git a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp index 27a8645884a..30d4de83a01 100644 --- a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp @@ -36,7 +36,7 @@ bool ReduceBaseTransformation::canBeTransformed(const TransformationContext& con return false; } - const auto axesConstant = ov::as_type_ptr(reduce->get_input_node_shared_ptr(1)); + const auto axesConstant = ov::as_type_ptr(reduce->get_input_node_shared_ptr(1)); if (axesConstant == nullptr) { return false; } diff --git a/src/common/low_precision_transformations/src/reduce_max.cpp b/src/common/low_precision_transformations/src/reduce_max.cpp index 76d040a61d2..8b49874e6f3 100644 --- a/src/common/low_precision_transformations/src/reduce_max.cpp +++ b/src/common/low_precision_transformations/src/reduce_max.cpp @@ -16,7 +16,7 @@ namespace low_precision { ReduceMaxTransformation::ReduceMaxTransformation(const Params& params) : ReduceBaseTransformation(params) { MATCHER_SCOPE(ReduceMaxTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -31,7 +31,7 @@ ReduceMaxTransformation::ReduceMaxTransformation(const Params& params) : ReduceB } bool ReduceMaxTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { - if (!ov::is_type(reduce)) { + if (!ov::is_type(reduce)) { return false; } @@ -40,7 +40,7 @@ bool ReduceMaxTransformation::canBeTransformed(const TransformationContext& cont } const auto dequantization = NetworkHelper::getDequantization(reduce, defaultPrecisions); - const std::vector scales = ov::as_type_ptr(dequantization.multiplyConstant)->cast_vector(); + const std::vector scales = ov::as_type_ptr(dequantization.multiplyConstant)->cast_vector(); if (std::any_of(scales.begin(), scales.end(), [](const float value) { return value < 0.0; })) { return false; } diff --git a/src/common/low_precision_transformations/src/reduce_mean.cpp b/src/common/low_precision_transformations/src/reduce_mean.cpp index 0540358cb08..10226670be2 100644 --- a/src/common/low_precision_transformations/src/reduce_mean.cpp +++ b/src/common/low_precision_transformations/src/reduce_mean.cpp @@ -16,7 +16,7 @@ namespace low_precision { ReduceMeanTransformation::ReduceMeanTransformation(const Params& params) : ReduceBaseTransformation(params) { MATCHER_SCOPE(ReduceMeanTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -31,7 +31,7 @@ ReduceMeanTransformation::ReduceMeanTransformation(const Params& params) : Reduc } bool ReduceMeanTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { - return ov::is_type(reduce) ? ReduceBaseTransformation::canBeTransformed(context, reduce) : false; + return ov::is_type(reduce) ? ReduceBaseTransformation::canBeTransformed(context, reduce) : false; } bool ReduceMeanTransformation::isPrecisionPreserved(std::shared_ptr reduce) const noexcept { diff --git a/src/common/low_precision_transformations/src/reduce_min.cpp b/src/common/low_precision_transformations/src/reduce_min.cpp index a8073fc5e2f..049c795769d 100644 --- a/src/common/low_precision_transformations/src/reduce_min.cpp +++ b/src/common/low_precision_transformations/src/reduce_min.cpp @@ -16,7 +16,7 @@ namespace low_precision { ReduceMinTransformation::ReduceMinTransformation(const Params& params) : ReduceBaseTransformation(params) { MATCHER_SCOPE(ReduceMinTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -31,7 +31,7 @@ ReduceMinTransformation::ReduceMinTransformation(const Params& params) : ReduceB } bool ReduceMinTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { - if (!ov::is_type(reduce)) { + if (!ov::is_type(reduce)) { return false; } @@ -40,7 +40,7 @@ bool ReduceMinTransformation::canBeTransformed(const TransformationContext& cont } const auto dequantization = NetworkHelper::getDequantization(reduce, defaultPrecisions); - const std::vector scales = ov::as_type_ptr(dequantization.multiplyConstant)->cast_vector(); + const std::vector scales = ov::as_type_ptr(dequantization.multiplyConstant)->cast_vector(); if (std::any_of(scales.begin(), scales.end(), [](const float value) { return value < 0.0; })) { return false; } diff --git a/src/common/low_precision_transformations/src/reduce_sum.cpp b/src/common/low_precision_transformations/src/reduce_sum.cpp index 5c46b4041ba..925afac8cf9 100644 --- a/src/common/low_precision_transformations/src/reduce_sum.cpp +++ b/src/common/low_precision_transformations/src/reduce_sum.cpp @@ -16,7 +16,7 @@ namespace low_precision { ReduceSumTransformation::ReduceSumTransformation(const Params& params) : ReduceBaseTransformation(params) { MATCHER_SCOPE(ReduceSumTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -31,7 +31,7 @@ ReduceSumTransformation::ReduceSumTransformation(const Params& params) : ReduceB } bool ReduceSumTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr reduce) const { - const auto reduceSum = ov::as_type_ptr(reduce); + const auto reduceSum = ov::as_type_ptr(reduce); if (!reduceSum || !ReduceBaseTransformation::canBeTransformed(context, reduceSum)) { return false; } @@ -57,7 +57,7 @@ void ReduceSumTransformation::changeDequantizationValues( ReduceBaseTransformation::changeDequantizationValues(reduce, dequantization); if (dequantization.subtract) { - const auto reduceSum = ov::as_type_ptr(reduce); + const auto reduceSum = ov::as_type_ptr(reduce); const auto reductionAxes = reduceSum->get_reduction_axes(); const auto inputShape = reduceSum->get_input_partial_shape(0); @@ -68,11 +68,11 @@ void ReduceSumTransformation::changeDequantizationValues( } // (a1 - s) + (a2 - s) + ... + (an - s) = (a1 + a2 + ... + an) - n * s - const auto reductionSizeConstant = opset1::Constant::create(deqPrecision, Shape{}, { static_cast(reductionSize) }); - const auto result = fold(dequantization.subtractConstant, reductionSizeConstant); + const auto reductionSizeConstant = ov::opset1::Constant::create(deqPrecision, Shape{}, { static_cast(reductionSize) }); + const auto result = fold(dequantization.subtractConstant, reductionSizeConstant); replace_node(dequantization.subtractConstant, result); - dequantization.subtractConstant = ov::as_type_ptr(result); + dequantization.subtractConstant = ov::as_type_ptr(result); } } diff --git a/src/common/low_precision_transformations/src/relu.cpp b/src/common/low_precision_transformations/src/relu.cpp index 7c4ae839391..2ad7054ee44 100644 --- a/src/common/low_precision_transformations/src/relu.cpp +++ b/src/common/low_precision_transformations/src/relu.cpp @@ -20,7 +20,7 @@ namespace low_precision { ReluTransformation::ReluTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(ReluTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); diff --git a/src/common/low_precision_transformations/src/reshape.cpp b/src/common/low_precision_transformations/src/reshape.cpp index c1fdf59e97f..89c3bf8af5b 100644 --- a/src/common/low_precision_transformations/src/reshape.cpp +++ b/src/common/low_precision_transformations/src/reshape.cpp @@ -24,15 +24,15 @@ namespace low_precision { ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(ReshapeTransformation); - auto input = pattern::any_input(); - auto mul_const_m = pattern::wrap_type(); - auto mul_m = pattern::wrap_type({ input, mul_const_m }); - auto reshape_pattern_const = pattern::wrap_type(); - auto reshape_pattern_nonconst = pattern::any_input(); + auto input = ov::pass::pattern::any_input(); + auto mul_const_m = pattern::wrap_type(); + auto mul_m = pattern::wrap_type({ input, mul_const_m }); + auto reshape_pattern_const = pattern::wrap_type(); + auto reshape_pattern_nonconst = ov::pass::pattern::any_input(); auto reshape_pattern = std::make_shared(OutputVector{ reshape_pattern_const, reshape_pattern_nonconst }); - auto matcher = pattern::wrap_type({ mul_m, reshape_pattern }); + auto matcher = pattern::wrap_type({ mul_m, reshape_pattern }); - ngraph::graph_rewrite_callback callback = [=](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [=](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -41,7 +41,7 @@ ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransf // we can propagate only per-tensor dq through reshape with non-const reshape_pattern const auto& pattern_map = m.get_pattern_value_map(); if (pattern_map.count(reshape_pattern_nonconst)) { - const auto mul_const = as_type_ptr(pattern_map.at(mul_const_m).get_node_shared_ptr()); + const auto mul_const = as_type_ptr(pattern_map.at(mul_const_m).get_node_shared_ptr()); if (!mul_const || ngraph::shape_size(mul_const->get_shape()) != 1) { return false; } @@ -56,14 +56,14 @@ ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransf namespace { -void reshapeDequantizationConstant(const std::shared_ptr& reshape, const std::vector& defaultPrecisions) { +void reshapeDequantizationConstant(const std::shared_ptr& reshape, const std::vector& defaultPrecisions) { // Reshape dequantization operation Constant. // 1. Calculate result dequantization Constant shape for broadcast based on original dequantization Constant shape and Reshape output. // For example: dequantization shape {1, 3, 1, 1}, output Reshape shape {1, 12, 3, 3}, result for broadcast: {1, 3, 4, 1}, // where '4' calculated for temporary broadcast before reshape. // 2. Broadcast dequantization Constant, if channels are changed // 3. Reshape and replace - auto replaceConstant = [](const std::shared_ptr& reshape, const std::shared_ptr& originalConstant) { + auto replaceConstant = [](const std::shared_ptr& reshape, const std::shared_ptr& originalConstant) { // reshape for element-wise constant is not required auto constantShape = originalConstant->get_shape(); if (NetworkHelper::isScalarLike(originalConstant)) { @@ -94,7 +94,7 @@ void reshapeDequantizationConstant(const std::shared_ptr& resha return; } - auto getBCastedConst = [](const std::shared_ptr& constant, size_t dimensionsToBroadcast) -> std::shared_ptr { + auto getBCastedConst = [](const std::shared_ptr& constant, size_t dimensionsToBroadcast) -> std::shared_ptr { if (dimensionsToBroadcast == 1ul) { return constant; } @@ -107,24 +107,24 @@ void reshapeDequantizationConstant(const std::shared_ptr& resha newOperationConstantBroadcastedShape[2] = dimensionsToBroadcast; } - const auto targetShapeConstant = opset1::Constant::create( + const auto targetShapeConstant = ov::opset1::Constant::create( element::i32, Shape{ newOperationConstantBroadcastedShape.size() }, newOperationConstantBroadcastedShape); - return fold(constant, targetShapeConstant); + return fold(constant, targetShapeConstant); }; const std::shared_ptr broadcastedConstant = getBCastedConst(originalConstant, dimensionsToBroadcast); std::vector newReshapeConstValues(reshapeOutputRank.get_length(), 1ul); newReshapeConstValues[1] = static_cast(reshapeOutputPShape[1].get_length()); - const std::shared_ptr newReshapeConstant = std::make_shared( + const std::shared_ptr newReshapeConstant = std::make_shared( element::i32, Shape({ newReshapeConstValues.size() }), newReshapeConstValues); - const std::shared_ptr resultConstant = fold( + const std::shared_ptr resultConstant = fold( broadcastedConstant, newReshapeConstant, reshape->get_special_zero()); @@ -146,7 +146,7 @@ void reshapeDequantizationConstant(const std::shared_ptr& resha } // namespace bool ReshapeTransformation::transform(TransformationContext& context, ngraph::pattern::Matcher &m) { - std::shared_ptr reshape = ov::as_type_ptr(m.get_match_root()); + std::shared_ptr reshape = ov::as_type_ptr(m.get_match_root()); if (NetworkHelper::isConstantPath(reshape)) { return false; } @@ -155,7 +155,7 @@ bool ReshapeTransformation::transform(TransformationContext& context, ngraph::pa return false; } - reshape = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(reshape, defaultPrecisions)); + reshape = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(reshape, defaultPrecisions)); reshapeDequantizationConstant(reshape, defaultPrecisions); moveDequantizationAfter(context, reshape, NetworkHelper::getDequantization(reshape, defaultPrecisions, 0), false); return true; @@ -200,7 +200,7 @@ bool ReshapeTransformation::canBeTransformed(const TransformationContext& contex const auto inputs = op->get_output_target_inputs(0); if (inputs.size() == 1ul) { const auto consumer = inputs.begin()->get_node(); - ignorePerTensorQuantizationCheck = ngraph::as_type(consumer) != nullptr; + ignorePerTensorQuantizationCheck = ngraph::as_type(consumer) != nullptr; } } diff --git a/src/common/low_precision_transformations/src/split.cpp b/src/common/low_precision_transformations/src/split.cpp index d49d79861cb..43228a02077 100644 --- a/src/common/low_precision_transformations/src/split.cpp +++ b/src/common/low_precision_transformations/src/split.cpp @@ -9,6 +9,7 @@ #include "low_precision/network_helper.hpp" #include "itt.hpp" +#include "ngraph/validation_util.hpp" namespace ngraph { namespace pass { @@ -16,9 +17,9 @@ namespace low_precision { SplitTransformation::SplitTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(SplitTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; @@ -43,11 +44,11 @@ bool SplitTransformation::transform(TransformationContext& context, ngraph::patt const auto newSplit = split->clone_with_new_inputs(inputs); newSplit->set_friendly_name(split->get_friendly_name()); - ngraph::copy_runtime_info(split, newSplit); + ov::copy_runtime_info(split, newSplit); - const int64_t axis = ov::as_type_ptr(split->get_input_node_shared_ptr(1))->cast_vector()[0]; + const int64_t axis = ov::as_type_ptr(split->get_input_node_shared_ptr(1))->cast_vector()[0]; OPENVINO_SUPPRESS_DEPRECATED_START - const size_t normalizedAxis = normalize_axis(split->get_friendly_name(), axis, split->get_input_partial_shape(0).rank()); + const size_t normalizedAxis = ngraph::normalize_axis(split->get_friendly_name(), axis, split->get_input_partial_shape(0).rank()); OPENVINO_SUPPRESS_DEPRECATED_END const size_t outputSize = newSplit->get_output_size(); @@ -97,7 +98,7 @@ bool SplitTransformation::transform(TransformationContext& context, ngraph::patt parent = subtract; } - const auto multiply = std::make_shared>(parent, splitedMul[i]); + const auto multiply = std::make_shared>(parent, splitedMul[i]); NetworkHelper::setOutDataPrecisionForTypeRelaxed(multiply, dequantization.multiply->get_output_element_type(0)); copy_runtime_info({ newSplit, multiply }, multiply); @@ -114,7 +115,7 @@ bool SplitTransformation::transform(TransformationContext& context, ngraph::patt // We do it to avoid dequantization propagation to the shapeOf subgraphs for (size_t i = 0; i < replacement.size(); ++i) { for (const auto& input : replacement[i].get_target_inputs()) { - if (const auto shapeOf = as_type_ptr(input.get_node()->shared_from_this())) { + if (const auto shapeOf = as_type_ptr(input.get_node()->shared_from_this())) { const auto newShapeOf = shapeOf->clone_with_new_inputs({ newSplit->output(i) }); replace_node_update_name(shapeOf, newShapeOf); } @@ -139,7 +140,7 @@ void SplitTransformation::updateOutputs( const auto lastNode = lastNodes[i]; for (auto output : lastNodes[i]->outputs()) { for (auto input : output.get_target_inputs()) { - if (ov::is_type(input.get_node())) { + if (ov::is_type(input.get_node())) { originalNode->set_friendly_name(originalName + LayerTransformation::originalLayerPostfix); lastNode->set_friendly_name(originalName + "." + std::to_string(i)); break; diff --git a/src/common/low_precision_transformations/src/strided_slice.cpp b/src/common/low_precision_transformations/src/strided_slice.cpp index 724bce6d4e9..363f5a38d69 100644 --- a/src/common/low_precision_transformations/src/strided_slice.cpp +++ b/src/common/low_precision_transformations/src/strided_slice.cpp @@ -17,10 +17,10 @@ namespace low_precision { namespace { -std::shared_ptr stridedSliceDeqConstant( +std::shared_ptr stridedSliceDeqConstant( const std::shared_ptr strSlice, const std::shared_ptr dequantizaitonConstant) { - auto constant = ov::as_type_ptr(dequantizaitonConstant); + auto constant = ov::as_type_ptr(dequantizaitonConstant); auto constantShape = constant->get_shape(); if (shape_size(constantShape) == 1ul) { return NetworkHelper::toScalar(constant); @@ -43,13 +43,13 @@ std::shared_ptr stridedSliceDeqConstant( } constantShape = newConstantShape; - const auto newConstant = fold( + const auto newConstant = fold( constant, - ngraph::opset1::Constant::create(ngraph::element::i32, { newConstantShape.size() }, newConstantShape)); - constant = ov::as_type_ptr(newConstant); + ov::opset1::Constant::create(ngraph::element::i32, { newConstantShape.size() }, newConstantShape)); + constant = ov::as_type_ptr(newConstant); } - const auto stridedSlice = ov::as_type_ptr(strSlice); + const auto stridedSlice = ov::as_type_ptr(strSlice); auto beginMask = stridedSlice->get_begin_mask(); auto endMask = stridedSlice->get_end_mask(); @@ -64,7 +64,7 @@ std::shared_ptr stridedSliceDeqConstant( } } - const auto result = fold( + const auto result = fold( constant, stridedSlice->input_value(1), stridedSlice->input_value(2), @@ -75,14 +75,14 @@ std::shared_ptr stridedSliceDeqConstant( stridedSlice->get_shrink_axis_mask(), stridedSlice->get_ellipsis_mask()); - return ov::as_type_ptr(NetworkHelper::toScalarIfPossible(result)); + return ov::as_type_ptr(NetworkHelper::toScalarIfPossible(result)); } } // namespace StridedSliceTransformation::StridedSliceTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(StridedSliceTransformation); - auto matcher = ngraph::pattern::wrap_type(); + auto matcher = ngraph::pattern::wrap_type(); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -119,7 +119,7 @@ bool StridedSliceTransformation::transform(TransformationContext& context, ngrap } bool StridedSliceTransformation::canBeTransformed(const TransformationContext& context, std::shared_ptr operation) const { - if (!ov::is_type(operation)) { + if (!ov::is_type(operation)) { return false; } diff --git a/src/common/low_precision_transformations/src/subtract.cpp b/src/common/low_precision_transformations/src/subtract.cpp index 80a78951c64..c368aa35eed 100644 --- a/src/common/low_precision_transformations/src/subtract.cpp +++ b/src/common/low_precision_transformations/src/subtract.cpp @@ -24,10 +24,10 @@ namespace low_precision { SubtractTransformation::SubtractTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(SubtractTransformation); - auto convert = pattern::wrap_type(); - auto multiply = pattern::wrap_type(); + auto convert = pattern::wrap_type(); + auto multiply = pattern::wrap_type(); auto subParent = std::make_shared(OutputVector{ convert, multiply }); - auto subtract = pattern::wrap_type({ subParent, pattern::wrap_type() }); + auto subtract = pattern::wrap_type({ subParent, pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -42,7 +42,7 @@ SubtractTransformation::SubtractTransformation(const Params& params) : LayerTran } bool SubtractTransformation::transform(TransformationContext& context, ngraph::pattern::Matcher &m) { - std::shared_ptr subtract = ov::as_type_ptr(m.get_match_root()); + std::shared_ptr subtract = ov::as_type_ptr(m.get_match_root()); if (!canBeTransformed(context, subtract)) { return false; } @@ -54,9 +54,9 @@ bool SubtractTransformation::transform(TransformationContext& context, ngraph::p // before: Y = X * SC - SH, after: Y = (X - SH') * SC // X * SC - SH = X * SC - SH' * SC // SH' = SH / SC - std::shared_ptr newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ + std::shared_ptr newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ dequantization.multiply->input_value(0), - ngraph::pass::low_precision::fold( + ngraph::pass::low_precision::fold( subtract->input_value(1), dequantization.multiply->input_value(1)) })); @@ -71,9 +71,9 @@ bool SubtractTransformation::transform(TransformationContext& context, ngraph::p } if (dequantization.subtract != nullptr) { - std::shared_ptr newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ + std::shared_ptr newSubtract = ov::as_type_ptr(subtract->clone_with_new_inputs({ dequantization.subtract->input_value(0), - fold(subtract->input_value(1), dequantization.subtractConstant) + fold(subtract->input_value(1), dequantization.subtractConstant) })); replace_node(subtract, newSubtract); @@ -85,7 +85,7 @@ bool SubtractTransformation::transform(TransformationContext& context, ngraph::p // std::shared_ptr newSubtract = NetworkHelper::optimizeElementwise(subtract); subtract->set_output_type(0, originalPrecision, subtract->get_output_partial_shape(0)); - replace_node(subtract, std::make_shared>( + replace_node(subtract, std::make_shared>( subtract->input_value(0), subtract->input_value(1))); } diff --git a/src/common/low_precision_transformations/src/transpose.cpp b/src/common/low_precision_transformations/src/transpose.cpp index ad5983d446c..39f4bf7abd9 100644 --- a/src/common/low_precision_transformations/src/transpose.cpp +++ b/src/common/low_precision_transformations/src/transpose.cpp @@ -19,7 +19,7 @@ namespace low_precision { TransposeTransformation::TransposeTransformation(const Params& params) : LayerTransformation(params) { MATCHER_SCOPE(TransposeTransformation); - auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ pattern::wrap_type(), pattern::wrap_type() }); ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); @@ -45,7 +45,7 @@ void transposeDequantizationConstant(std::shared_ptr& transpose, const std } auto transposeDeqConstant = []( - const std::shared_ptr& dequantizationConstant, + const std::shared_ptr& dequantizationConstant, const PartialShape& transposeOutputPShape, const std::shared_ptr& transposeConstant) -> std::shared_ptr { const auto constantShape = dequantizationConstant->get_shape(); @@ -56,11 +56,11 @@ void transposeDequantizationConstant(std::shared_ptr& transpose, const std assert(transposeOutputPShape.rank().is_static()); const size_t transposeOutRank = transposeOutputPShape.rank().get_length(); if (constantShape.size() != transposeOutRank) { - const auto unsqueezeConst = opset1::Constant::create(element::i32, Shape{ 1 }, std::vector{ 0 }); - const auto deqConstantWithBatch = fold(dequantizationConstant, unsqueezeConst); - return fold(deqConstantWithBatch, transposeConstant); + const auto unsqueezeConst = ov::opset1::Constant::create(element::i32, Shape{ 1 }, std::vector{ 0 }); + const auto deqConstantWithBatch = fold(dequantizationConstant, unsqueezeConst); + return fold(deqConstantWithBatch, transposeConstant); } else { - return fold(dequantizationConstant, transposeConstant); + return fold(dequantizationConstant, transposeConstant); } }; @@ -104,7 +104,7 @@ bool TransposeTransformation::canBeTransformed(const TransformationContext& cont return false; } - const std::shared_ptr constant = ov::as_type_ptr(op->get_input_node_shared_ptr(1)); + const std::shared_ptr constant = ov::as_type_ptr(op->get_input_node_shared_ptr(1)); if (constant == nullptr) { return false; } @@ -133,7 +133,7 @@ bool TransposeTransformation::canBeTransformed(const TransformationContext& cont } } - auto checkShape = [](const std::shared_ptr& dequantizationConstant, const PartialShape& transposeOutputShape) -> bool { + auto checkShape = [](const std::shared_ptr& dequantizationConstant, const PartialShape& transposeOutputShape) -> bool { const auto dequantizationShape = dequantizationConstant->get_shape(); const auto rank = transposeOutputShape.rank(); if (rank.is_dynamic()) { diff --git a/src/common/low_precision_transformations/src/variadic_split.cpp b/src/common/low_precision_transformations/src/variadic_split.cpp index 63f0a569354..a15e6a60929 100644 --- a/src/common/low_precision_transformations/src/variadic_split.cpp +++ b/src/common/low_precision_transformations/src/variadic_split.cpp @@ -16,12 +16,12 @@ namespace low_precision { VariadicSplitTransformation::VariadicSplitTransformation(const Params& params) : SplitTransformation(params) { MATCHER_SCOPE(VariadicSplitTransformation); - auto matcher = pattern::wrap_type({ - pattern::wrap_type(), - pattern::wrap_type(), - pattern::wrap_type() }); + auto matcher = pattern::wrap_type({ + pattern::wrap_type(), + pattern::wrap_type(), + pattern::wrap_type() }); - ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) { + ov::graph_rewrite_callback callback = [this](pattern::Matcher& m) { auto op = m.get_match_root(); if (transformation_callback(op)) { return false; diff --git a/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp b/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp index b147fb67f31..aac6ae58e90 100644 --- a/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/weightable_layer_transformation.cpp @@ -16,19 +16,19 @@ namespace low_precision { namespace { std::vector getWeightsDequantizationIdces(const std::shared_ptr weightableLayer) { - if (ov::is_type(weightableLayer)) { + if (ov::is_type(weightableLayer)) { return std::vector{0}; - } else if (ov::is_type(weightableLayer)) { + } else if (ov::is_type(weightableLayer)) { return std::vector{1}; - } else if (ov::is_type(weightableLayer)) { - return ov::is_type(weightableLayer->get_input_node_shared_ptr(1)) ? std::vector{0} + } else if (ov::is_type(weightableLayer)) { + return ov::is_type(weightableLayer->get_input_node_shared_ptr(1)) ? std::vector{0} : std::vector{0, 1}; } else { THROW_IE_LPT_EXCEPTION(*weightableLayer) << "getWeightsDequantizationIdces is called for unexpected layer"; } } -bool checkConstShape(const std::vector& idcesToCheck, const std::shared_ptr constant) { +bool checkConstShape(const std::vector& idcesToCheck, const std::shared_ptr constant) { const auto& shape = constant->get_shape(); if (shape_size(shape) == 1) { return true; @@ -62,7 +62,7 @@ bool WeightableLayerTransformation::canConvolutionBeTransformed(const Transforma return false; } - std::shared_ptr reshapeFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); + std::shared_ptr reshapeFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); dequantization = reshapeFromWeights == nullptr ? NetworkHelper::getDequantization(layer, defaultPrecisions, 1ul) : NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions); @@ -162,20 +162,20 @@ bool WeightableLayerTransformation::canBeTransformed(const TransformationContext // TODO Implement similar checks in other weightable operaitons - const std::shared_ptr reshapeFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); + const std::shared_ptr reshapeFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); - std::shared_ptr fqFromWeights; + std::shared_ptr fqFromWeights; if (reshapeFromWeights == nullptr) { - fqFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); + fqFromWeights = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); if (fqFromWeights == nullptr) { const FakeQuantizeDequantization dequantization = NetworkHelper::getDequantization(layer, defaultPrecisions, 1ul); - fqFromWeights = ov::as_type_ptr(dequantization.data.get_node_shared_ptr()); + fqFromWeights = ov::as_type_ptr(dequantization.data.get_node_shared_ptr()); } } else { - fqFromWeights = ov::as_type_ptr(reshapeFromWeights->get_input_node_shared_ptr(0)); + fqFromWeights = ov::as_type_ptr(reshapeFromWeights->get_input_node_shared_ptr(0)); if (fqFromWeights == nullptr) { const FakeQuantizeDequantization dequantization = NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions, 0ul); - fqFromWeights = ov::as_type_ptr(dequantization.data.get_node_shared_ptr()); + fqFromWeights = ov::as_type_ptr(dequantization.data.get_node_shared_ptr()); } } @@ -225,7 +225,7 @@ bool WeightableLayerTransformation::canBeTransformed(const TransformationContext return false; } - const auto weightsData = ov::as_type_ptr(dequantizationOnWeights.data.get_node_shared_ptr()); + const auto weightsData = ov::as_type_ptr(dequantizationOnWeights.data.get_node_shared_ptr()); if (weightsData == nullptr) { return false; } @@ -258,18 +258,18 @@ bool WeightableLayerTransformation::isQuantizedStatic(const std::shared_ptrget_input_node_shared_ptr(1); - std::shared_ptr parent = ov::is_type(reshape) ? + std::shared_ptr parent = ov::is_type(reshape) ? reshape->get_input_node_shared_ptr(0) : reshape; - const auto fq = ov::as_type_ptr(parent); + const auto fq = ov::as_type_ptr(parent); if (fq != nullptr) { return NetworkHelper::isQuantizeSupported(fq); } dequantizationOnWeights = NetworkHelper::getDequantization(parent, defaultPrecisions, 0, true); - } else if (ov::is_type(layer->get_input_node_shared_ptr(1))) { - const std::shared_ptr fq = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); + } else if (ov::is_type(layer->get_input_node_shared_ptr(1))) { + const std::shared_ptr fq = ov::as_type_ptr(layer->get_input_node_shared_ptr(1)); return NetworkHelper::isQuantizeSupported(fq); } else { // TODO: update NetworkHelper API later @@ -289,11 +289,11 @@ bool WeightableLayerTransformation::isQuantizedStatic(const std::shared_ptr(deqData)) { + if (ov::is_type(deqData)) { deqData = deqData->get_input_node_shared_ptr(0); } // TODO: LPT: is it possible to share with canBeTransformed? - if (ov::is_type(deqData)) { + if (ov::is_type(deqData)) { const ngraph::element::Type weightsDataPrecision = dequantizationOnWeights.data.get_element_type(); if (!DataPrecision::isSupported(weightsDataPrecision)) { return false; @@ -306,9 +306,9 @@ bool WeightableLayerTransformation::isQuantizedStatic(const std::shared_ptr(deqData)) { + } else if (auto fq = ov::as_type_ptr(deqData)) { for (size_t i = 1; i < fq->get_input_size(); ++i) { - if (auto constant = ov::as_type_ptr(fq->get_input_node_shared_ptr(i))) { + if (auto constant = ov::as_type_ptr(fq->get_input_node_shared_ptr(i))) { if (!checkConstShape(dqIdces, constant)) { return false; } @@ -358,7 +358,7 @@ bool WeightableLayerTransformation::decomposeFakeQuantizeForWeightsPath(const st return false; } - if (ov::as_type_ptr(fqOnWeights) == nullptr) { + if (ov::as_type_ptr(fqOnWeights) == nullptr) { THROW_IE_LPT_EXCEPTION(*fqOnWeights) << "FakeQuantize on weights was not folded to constant"; } @@ -366,7 +366,7 @@ bool WeightableLayerTransformation::decomposeFakeQuantizeForWeightsPath(const st } bool WeightableLayerTransformation::isGroup(const std::shared_ptr& layer) { - if (!ov::is_type(layer) && !ov::is_type(layer)) { + if (!ov::is_type(layer) && !ov::is_type(layer)) { return false; } @@ -375,7 +375,7 @@ bool WeightableLayerTransformation::isGroup(const std::shared_ptr& layer) } bool WeightableLayerTransformation::isDepthwise(const std::shared_ptr& layer) { - if (!ov::as_type_ptr(layer) && !ov::as_type_ptr(layer)) { + if (!ov::as_type_ptr(layer) && !ov::as_type_ptr(layer)) { return false; } @@ -385,11 +385,11 @@ bool WeightableLayerTransformation::isDepthwise(const std::shared_ptr& lay return (group == inputChannelsCount) && (inputChannelsCount == outputChannelsCount); } -std::shared_ptr WeightableLayerTransformation::getFakeQuantizeOnWeights(const std::shared_ptr& node) { - auto fq = ov::as_type_ptr(node->get_input_node_shared_ptr(1)); +std::shared_ptr WeightableLayerTransformation::getFakeQuantizeOnWeights(const std::shared_ptr& node) { + auto fq = ov::as_type_ptr(node->get_input_node_shared_ptr(1)); // TODO: temporary workaround if (fq == nullptr) { - fq = ov::as_type_ptr(node->get_input_node_ptr(1)->get_input_node_shared_ptr(0)); + fq = ov::as_type_ptr(node->get_input_node_ptr(1)->get_input_node_shared_ptr(0)); } return fq; @@ -417,7 +417,7 @@ bool WeightableLayerTransformation::isAsymmetricOnWeights( const std::vector& defaultPrecisions) { const auto n = const_cast(node.get())->shared_from_this(); - const auto reshapeFromWeights = ngraph::as_type_ptr(n->get_input_node_shared_ptr(1)); + const auto reshapeFromWeights = ngraph::as_type_ptr(n->get_input_node_shared_ptr(1)); const auto dequantization = reshapeFromWeights == nullptr ? NetworkHelper::getDequantization(n, defaultPrecisions, 1ul) : NetworkHelper::getDequantization(reshapeFromWeights, defaultPrecisions); diff --git a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp index 05ea6525a2a..e905a7d6608 100644 --- a/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp +++ b/src/common/low_precision_transformations/tests/concat_with_neighbors_transformation_with_convolution.cpp @@ -105,7 +105,7 @@ public: testValues.actual.dequantization3); auto supportedPrecisionsOnActivation = std::vector({ - ngraph::pass::low_precision::PrecisionsRestriction::create({ + ngraph::pass::low_precision::PrecisionsRestriction::create({ {{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}} }) @@ -114,14 +114,14 @@ public: auto quantizationRestrictions = testValues.multiChannels ? std::vector() : std::vector({ - ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}) + ngraph::pass::low_precision::QuantizationGranularityRestriction::create({0}) }); SimpleLowPrecisionTransformer transform(supportedPrecisionsOnActivation, quantizationRestrictions); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); - transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); + transform.add(testValues.params); transform.transform(actualFunction); referenceFunction = ngraph::builder::subgraph::PrecisionPropagationFunction::getReferenceWithNeighbors( @@ -157,13 +157,13 @@ TEST_P(ConcatWithNeighborsWithConvolutionTransformation, CompareFunctions) { //auto res = compare_functions(actualFunction, referenceFunction, true, false, false); //ASSERT_TRUE(res.first) << res.second; - auto actualFakeQuantizes = LayerTransformation::get(actualFunction); + auto actualFakeQuantizes = LayerTransformation::get(actualFunction); ASSERT_EQ(3ul, actualFakeQuantizes.size()) << "unexpected FakeQuantize operations count " << actualFakeQuantizes.size(); ASSERT_TRUE(checkIfOutputAttributesSharedValuesAreTheSame(actualFakeQuantizes)) << "PrecisionsAttribute shared values are not the same"; - auto actualConcatOperations = LayerTransformation::get(actualFunction); + auto actualConcatOperations = LayerTransformation::get(actualFunction); ASSERT_EQ(2ul, actualConcatOperations.size()) << "unexpected concat operations"; ASSERT_FALSE(ngraph::pass::low_precision::getAttribute(actualConcatOperations[0]).empty()); ASSERT_FALSE(ngraph::pass::low_precision::getAttribute(actualConcatOperations[1]).empty()); @@ -172,7 +172,7 @@ TEST_P(ConcatWithNeighborsWithConvolutionTransformation, CompareFunctions) { ASSERT_TRUE(checkIfAttributesSharedValuesAreTheSame(actualConcatOperations)) << "IntervalsAlignmentAttribute shared values are not the same"; - auto convolutions = LayerTransformation::get(actualFunction); + auto convolutions = LayerTransformation::get(actualFunction); ASSERT_EQ(1ul, convolutions.size()) << "unexpected convolution operations"; ASSERT_EQ(2ul, convolutions[0]->input(0).get_rt_info().size()) << "unexpected input 0 attributes count: LowPrecision::PerTensorQuantization & LowPrecision::Precisions"; diff --git a/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp b/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp index 4dc3199406a..05032605fa5 100644 --- a/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp +++ b/src/common/low_precision_transformations/tests/is_function_quantized_transformation.cpp @@ -33,7 +33,7 @@ public: void SetUp() override { const auto testValues = GetParam(); - const auto input = std::make_shared(testValues.precision, ngraph::Shape(testValues.shape)); + const auto input = std::make_shared(testValues.precision, ngraph::Shape(testValues.shape)); const auto fakeQuantize = ngraph::builder::subgraph::makeFakeQuantize( input, testValues.precision, @@ -44,7 +44,7 @@ public: replace_node(fakeQuantize->get_input_node_shared_ptr(3), input); } - ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; + ngraph::ResultVector results{ std::make_shared(fakeQuantize) }; function = std::make_shared(results, ngraph::ParameterVector{ input }, "IsFunctionQuantizedFunction"); function->validate_nodes_and_infer_types(); } diff --git a/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp b/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp index 2306cd81565..745c18380ea 100644 --- a/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp +++ b/src/common/low_precision_transformations/tests/markup_avg_pool_precisions_transformation.cpp @@ -83,7 +83,7 @@ public: pass.run_on_model(actualFunction); auto supportedPrecisionsOnActivation = std::vector( - {ngraph::pass::low_precision::PrecisionsRestriction::create( + {ngraph::pass::low_precision::PrecisionsRestriction::create( {{{0}, {ngraph::element::u8}}, {{1}, {ngraph::element::i8}}})}); SimpleLowPrecisionTransformer transform(supportedPrecisionsOnActivation); @@ -132,7 +132,7 @@ TEST_P(MarkupAvgPoolPrecisionsTransformation, CompareFunctions) { ov::pass::InitNodeInfo().run_on_model(actualFunction); actualFunction->validate_nodes_and_infer_types(); - const auto avgPoolOperations = LayerTransformation::get(actualFunction); + const auto avgPoolOperations = LayerTransformation::get(actualFunction); ASSERT_EQ(1ul, avgPoolOperations.size()) << "unexpected avgPoolOperations size: " << avgPoolOperations.size(); { @@ -142,7 +142,7 @@ TEST_P(MarkupAvgPoolPrecisionsTransformation, CompareFunctions) { ASSERT_EQ(true, avgPoolPrecisioinPreservedAttribute.as().value()); } - const auto precisionPreserved = LayerTransformation::get(actualFunction); + const auto precisionPreserved = LayerTransformation::get(actualFunction); ASSERT_TRUE(checkIfAttributesAreTheSame(precisionPreserved)) << "AvgPoolPrecisionPreservedAttribute are not the same"; diff --git a/src/common/offline_transformations/include/mask_attribute.hpp b/src/common/offline_transformations/include/mask_attribute.hpp index 22ad9ba70d0..c06d069e8c4 100644 --- a/src/common/offline_transformations/include/mask_attribute.hpp +++ b/src/common/offline_transformations/include/mask_attribute.hpp @@ -18,6 +18,8 @@ #include #include +#include "openvino/util/log.hpp" + namespace ngraph { /** @@ -211,7 +213,7 @@ public: bool add_callback(const std::function& receive_callback, Mask::Ptr mask) { if (m_callbacks.find(mask.get()) != m_callbacks.end()) - NGRAPH_DEBUG << "Attempt to rewrite callback, could lead to unexpected behaviour"; + OPENVINO_DEBUG << "Attempt to rewrite callback, could lead to unexpected behaviour"; m_callbacks[mask.get()] = receive_callback; m_dependencies.push_back(mask.get()); diff --git a/src/common/offline_transformations/src/pruning/init_const_mask.cpp b/src/common/offline_transformations/src/pruning/init_const_mask.cpp index e9352615f90..a78c4a23d04 100644 --- a/src/common/offline_transformations/src/pruning/init_const_mask.cpp +++ b/src/common/offline_transformations/src/pruning/init_const_mask.cpp @@ -28,8 +28,9 @@ ngraph::pass::InitConstMask::InitConstMask(const ngraph::AxisSet& dims, for (const auto& dim : dims) { if (dim >= shape.size()) { - NGRAPH_DEBUG << "[WARNING] Attemt to initialize masks on " << dim << " dimension which is out of shape " - << shape << " for node (" << const_node->get_friendly_name() << ")"; + OPENVINO_DEBUG << "[WARNING] Attemt to initialize masks on " << dim + << " dimension which is out of shape " << shape << " for node (" + << const_node->get_friendly_name() << ")"; continue; } @@ -61,7 +62,7 @@ ngraph::pass::InitConstMask::InitConstMask(const ngraph::AxisSet& dims, setInitMask(const_node, mask); #endif if (!mask->all_dims_are_empty()) { - NGRAPH_DEBUG << "MASK (" << const_node->get_friendly_name() << ") " << *mask << std::endl; + OPENVINO_DEBUG << "MASK (" << const_node->get_friendly_name() << ") " << *mask << std::endl; } return false; diff --git a/src/common/offline_transformations/src/pruning/init_masks.cpp b/src/common/offline_transformations/src/pruning/init_masks.cpp index 709090e9561..c2fa9b2262f 100644 --- a/src/common/offline_transformations/src/pruning/init_masks.cpp +++ b/src/common/offline_transformations/src/pruning/init_masks.cpp @@ -42,8 +42,8 @@ public: cur_node = cur_node->get_input_node_shared_ptr(0); } if (!ngraph::is_type(cur_node)) { - NGRAPH_DEBUG << "Can't find Constant weights for Convolution: " - << m_output.get_node()->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "Can't find Constant weights for Convolution: " + << m_output.get_node()->get_friendly_name() << std::endl; return false; } @@ -101,16 +101,17 @@ public: dim_order = new_order; } else { if (ngraph::is_type(cur_node) || ngraph::is_type(cur_node)) { - NGRAPH_DEBUG << "Can't init mask for MatMul: " << matmul->get_friendly_name() - << " because of node " << cur_node->get_friendly_name() - << " in the way from weights to Matmul" << std::endl; + OPENVINO_DEBUG << "Can't init mask for MatMul: " << matmul->get_friendly_name() + << " because of node " << cur_node->get_friendly_name() + << " in the way from weights to Matmul" << std::endl; return false; } } cur_node = cur_node->get_input_node_shared_ptr(0); } if (!ngraph::is_type(cur_node)) { - NGRAPH_DEBUG << "Can't find Constant weights for MatMul: " << matmul->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "Can't find Constant weights for MatMul: " << matmul->get_friendly_name() + << std::endl; return false; } // 2. Get constant rank to set mask on last dimension @@ -118,7 +119,7 @@ public: const auto shape_rank = const_op->get_shape().size(); const size_t shift = (matmul->get_transpose_b()) ? 2 : 1; if (shape_rank < shift) { - NGRAPH_DEBUG << "Can't init mask for MatMul: " << matmul->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "Can't init mask for MatMul: " << matmul->get_friendly_name() << std::endl; return false; } const auto idx = shape_rank - shift; diff --git a/src/common/offline_transformations/src/pruning/propagate_masks.cpp b/src/common/offline_transformations/src/pruning/propagate_masks.cpp index b4985e7ec03..65b091c89f6 100644 --- a/src/common/offline_transformations/src/pruning/propagate_masks.cpp +++ b/src/common/offline_transformations/src/pruning/propagate_masks.cpp @@ -17,6 +17,7 @@ #include #include "mask_attribute.hpp" +#include "openvino/util/log.hpp" #include "pruning.hpp" namespace ngraph { @@ -78,17 +79,17 @@ public: auto b_mask = getMask(m_b); if (!a_mask && !b_mask) { - NGRAPH_DEBUG << "No mask for any input of " << m_matmul.get_node()->get_friendly_name() << "\n"; + OPENVINO_DEBUG << "No mask for any input of " << m_matmul.get_node()->get_friendly_name() << "\n"; return false; } if (!b_mask) { - NGRAPH_DEBUG << "No mask for input b of " << m_matmul.get_node()->get_friendly_name() << "\n"; + OPENVINO_DEBUG << "No mask for input b of " << m_matmul.get_node()->get_friendly_name() << "\n"; return false; } const auto matmul_range = m_matmul.get_shape().size(); if (matmul_range < 2) { - NGRAPH_DEBUG << "Matmul operation with rank = 1 is not supported by pruning algo by now\n"; + OPENVINO_DEBUG << "Matmul operation with rank = 1 is not supported by pruning algo by now\n"; return false; } @@ -216,7 +217,7 @@ public: // Weights mask for convolution should be initialized in the InitMasks pass (and propagate after it). // If mask isn't initialized - this weights (and hence all convolution) can't be pruned for some reason. if (!weights_mask) { - NGRAPH_DEBUG << "No weights mask for " << m_output.get_node()->get_friendly_name() << "\n"; + OPENVINO_DEBUG << "No weights mask for " << m_output.get_node()->get_friendly_name() << "\n"; return false; } auto weights_mask_row = weights_mask.get(); @@ -309,8 +310,8 @@ public: weights_mask = std::make_shared(weights_shape.size()); setMask(m_weights, weights_mask); } else { - NGRAPH_DEBUG << "GroupConvolution: No weights mask and weights aren't constant for " - << *m_output.get_node() << "\n"; + OPENVINO_DEBUG << "GroupConvolution: No weights mask and weights aren't constant for " + << *m_output.get_node() << "\n"; return false; } } @@ -401,7 +402,7 @@ public: const auto constant = get_constant_from_source(m_shape.get_node_shared_ptr()); OPENVINO_SUPPRESS_DEPRECATED_END if (!constant) { - NGRAPH_DEBUG << "Can't get constant from source node " << m_shape.get_node()->get_friendly_name(); + OPENVINO_DEBUG << "Can't get constant from source node " << m_shape.get_node()->get_friendly_name(); return false; } auto input_mask_row = input_mask.get(); @@ -479,8 +480,8 @@ public: return false; if (m_output.get_node_shared_ptr()->get_autob() != op::AutoBroadcastType::NUMPY) { - NGRAPH_DEBUG << "Can't propagate mask through " << m_output.get_node()->get_friendly_name() - << " because node is using unsupported broadcast mode." << std::endl; + OPENVINO_DEBUG << "Can't propagate mask through " << m_output.get_node()->get_friendly_name() + << " because node is using unsupported broadcast mode." << std::endl; return false; } // Case when input masks should be united instead of intersection @@ -541,8 +542,8 @@ public: // Prevent case when input_shape and weights_shape both has broadcasted dims if (input_shape_broadcasted_dims.size() && weights_shape_broadcasted_dims.size()) { - NGRAPH_DEBUG << "Can't propagate mask through " << m_output.get_node()->get_friendly_name() - << " because both input shapes contains broadcasted dims." << std::endl; + OPENVINO_DEBUG << "Can't propagate mask through " << m_output.get_node()->get_friendly_name() + << " because both input shapes contains broadcasted dims." << std::endl; return false; } @@ -562,14 +563,14 @@ public: } if (!input_mask) { - NGRAPH_DEBUG << "No input mask for: " << m_output.get_node()->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "No input mask for: " << m_output.get_node()->get_friendly_name() << std::endl; return false; } if (!weights_mask) { // Set dummy mask to weight input in case this input has no mask // and has broadcastable dimentions if (!weights_shape_broadcasted_dims.size()) { - NGRAPH_DEBUG << "No weights mask for: " << m_output.get_node()->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "No weights mask for: " << m_output.get_node()->get_friendly_name() << std::endl; return false; } weights_mask = std::make_shared(m_weights.get_partial_shape().rank().get_length()); @@ -664,7 +665,7 @@ public: // Input mask is the only source of pruning in FQ if (!input_mask) { - NGRAPH_DEBUG << "FakeQuantize: No input mask for " << *m_output.get_node() << "\n"; + OPENVINO_DEBUG << "FakeQuantize: No input mask for " << *m_output.get_node() << "\n"; return false; } @@ -1138,9 +1139,9 @@ public: constant = get_constant_from_source(m_weights.get_node_shared_ptr()); OPENVINO_SUPPRESS_DEPRECATED_END if (!constant) { - NGRAPH_DEBUG << "Can't process reshape node " << m_output.get_node()->get_friendly_name() - << " with no constant node " << m_weights.get_node()->get_friendly_name() - << " as shape input."; + OPENVINO_DEBUG << "Can't process reshape node " << m_output.get_node()->get_friendly_name() + << " with no constant node " << m_weights.get_node()->get_friendly_name() + << " as shape input."; return false; } } @@ -1385,19 +1386,19 @@ public: const auto input_order_node = get_constant_from_source(m_weights.get_node_shared_ptr()); OPENVINO_SUPPRESS_DEPRECATED_END if (!input_order_node) { - NGRAPH_DEBUG << "Can't process transpose node " << m_output.get_node()->get_friendly_name() - << " with no constant node " << m_weights.get_node()->get_friendly_name() - << " as input_order input."; + OPENVINO_DEBUG << "Can't process transpose node " << m_output.get_node()->get_friendly_name() + << " with no constant node " << m_weights.get_node()->get_friendly_name() + << " as input_order input."; return false; } const auto input_mask = getMask(m_input); if (!input_mask) { - NGRAPH_DEBUG << "No input mask for: " << m_output.get_node()->get_friendly_name() << std::endl; + OPENVINO_DEBUG << "No input mask for: " << m_output.get_node()->get_friendly_name() << std::endl; return false; } if (static_cast(input_mask->size()) != m_output.get_partial_shape().rank().get_length()) { - NGRAPH_DEBUG << "Transpose which change tensor rank is not supported yet."; + OPENVINO_DEBUG << "Transpose which change tensor rank is not supported yet."; return false; } @@ -1627,8 +1628,8 @@ public: // Invalidate current mask and its parent masks output_mask->apply_callback(input_mask); - NGRAPH_DEBUG << "Invalidate masks for " << *input.get_node() << " because " << node - << " is in scope of stop ops.\n"; + OPENVINO_DEBUG << "Invalidate masks for " << *input.get_node() << " because " << node + << " is in scope of stop ops.\n"; any_input_with_masks = true; } } diff --git a/src/common/offline_transformations/src/pruning/shrink_weights.cpp b/src/common/offline_transformations/src/pruning/shrink_weights.cpp index 5e203e9d34a..da5cce4ffc7 100644 --- a/src/common/offline_transformations/src/pruning/shrink_weights.cpp +++ b/src/common/offline_transformations/src/pruning/shrink_weights.cpp @@ -57,7 +57,7 @@ static bool maybe_adopt_reshape_node(std::shared_ptr reshape, ngraph:: const auto shape = reshape->input_value(1); const auto consumers = shape.get_node()->get_output_target_inputs(0); if (shape.get_node()->outputs().size() != 1 || consumers.size() != 1) { - NGRAPH_DEBUG << "Adoptation for node " << shape.get_node()->get_friendly_name() << " is not supported."; + OPENVINO_DEBUG << "Adoptation for node " << shape.get_node()->get_friendly_name() << " is not supported."; return false; } @@ -88,8 +88,8 @@ static bool maybe_adopt_reshape_node(std::shared_ptr reshape, ngraph:: consumers.begin()->replace_source_output(sub); copy_runtime_info(shape.get_node_shared_ptr(), {sub_const, sub}); - NGRAPH_DEBUG << "Adopting values in (" << shape.get_node()->get_friendly_name() << ")" - << " by substracting " << vec_to_str(sub_const_vector); + OPENVINO_DEBUG << "Adopting values in (" << shape.get_node()->get_friendly_name() << ")" + << " by substracting " << vec_to_str(sub_const_vector); return true; } @@ -200,7 +200,7 @@ bool ngraph::pass::ShrinkWeights::run_on_model(const std::shared_ptroutput(0)); if (!mask && init_mask) - NGRAPH_DEBUG << "Mask was ruined for node:" << node->get_friendly_name() << "\nInit mask: " << *init_mask; + OPENVINO_DEBUG << "Mask was ruined for node:" << node->get_friendly_name() << "\nInit mask: " << *init_mask; #endif if (is_static_reshape_op(node) && not_empty_mask(mask) && !ov::op::util::is_constant(node->get_input_node_ptr(1))) @@ -239,8 +239,8 @@ bool ngraph::pass::ShrinkWeights::run_on_model(const std::shared_ptrget_friendly_name() - << "\nInit mask: " << *init_mask << "\nCurrent mask: " << *mask; + OPENVINO_DEBUG << "Mask was ruined for node:" << const_node->get_friendly_name() + << "\nInit mask: " << *init_mask << "\nCurrent mask: " << *mask; break; } } @@ -262,8 +262,8 @@ bool ngraph::pass::ShrinkWeights::run_on_model(const std::shared_ptrget_friendly_name() << "): " << vec_to_str(value) - << " to " << vec_to_str(new_const_value); + OPENVINO_DEBUG << "Adjust value in (" << const_node->get_friendly_name() << "): " << vec_to_str(value) + << " to " << vec_to_str(new_const_value); continue; } auto last_output = const_node->output(0); @@ -282,8 +282,8 @@ bool ngraph::pass::ShrinkWeights::run_on_model(const std::shared_ptrget_element_type(), Shape{res.size()}, res); replace_node(const_node, new_const); copy_runtime_info(const_node, new_const); - NGRAPH_DEBUG << "Transform shape like (" << last_output.get_node()->get_friendly_name() - << "): " << const_node->get_shape_val() << " to " << new_const->get_shape_val() << std::endl; + OPENVINO_DEBUG << "Transform shape like (" << last_output.get_node()->get_friendly_name() + << "): " << const_node->get_shape_val() << " to " << new_const->get_shape_val() << std::endl; new_const->set_friendly_name(const_node->get_friendly_name()); } else { for (size_t dim = 0; dim < mask->size(); ++dim) { @@ -308,13 +308,13 @@ bool ngraph::pass::ShrinkWeights::run_on_model(const std::shared_ptrget_node()); ngraph::NodeMap node_map; + OPENVINO_SUPPRESS_DEPRECATED_START ngraph::clone_nodes(original_nodes, node_map); + OPENVINO_SUPPRESS_DEPRECATED_END for (auto it = begin; it != end; it++) { // copy by value, so result shared_pointer point to new objects Expression new_expr = **it; diff --git a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp index 52acd6c4628..68d3cf976ca 100644 --- a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp @@ -19,6 +19,7 @@ #include "compare.hpp" #include "itt.hpp" +#include "openvino/util/log.hpp" using namespace std; using namespace ov; @@ -38,7 +39,7 @@ static bool simplify_gather(shared_ptr node) { auto axis = gather->get_axis(); if (axis == opset3::Gather::AXIS_NOT_SET_VALUE) { - NGRAPH_DEBUG << "axis value not set"; + OPENVINO_DEBUG << "axis value not set"; return false; } @@ -111,7 +112,7 @@ static bool eliminate_reshape_v1(const shared_ptr& node) { // check if reshape is not identity op if (input.get_partial_shape().is_dynamic() || node->get_output_partial_shape(0).is_dynamic()) { - NGRAPH_DEBUG << node << " has dynamic shapes."; + OPENVINO_DEBUG << node << " has dynamic shapes."; return false; } // remove identity op diff --git a/src/common/transformations/src/transformations/common_optimizations/optimize_strided_slice.cpp b/src/common/transformations/src/transformations/common_optimizations/optimize_strided_slice.cpp index c930277bb49..86c5f37c88e 100644 --- a/src/common/transformations/src/transformations/common_optimizations/optimize_strided_slice.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/optimize_strided_slice.cpp @@ -43,6 +43,7 @@ bool ov::pass::UselessStridedSliceEraser::run_on_model(const std::shared_ptr slice) { diff --git a/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp index 2cc7205994d..d846c5f6f9f 100644 --- a/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp @@ -18,6 +18,7 @@ #include #include "itt.hpp" +#include "openvino/util/log.hpp" #include "transformations/utils/utils.hpp" namespace ov { @@ -69,18 +70,18 @@ public: const auto& input_pshape = input.get_partial_shape(); const auto input_rank = input_pshape.rank(); if (input_rank.is_dynamic()) { - NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: input rank is dynamic"; + OPENVINO_DEBUG << "Axis calculated to materialize RIC on input: input rank is dynamic"; return; } const auto axis = get_axis(); // Despite of m_axis is signed integer this transformartion does not handle negative axes values if (axis < 0 || axis >= static_cast(input_pshape.size())) { - NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is out of range"; + OPENVINO_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is out of range"; return; } const auto& axis_dim = input_pshape[axis]; if (axis_dim.is_dynamic()) { - NGRAPH_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is dynamic"; + OPENVINO_DEBUG << "Axis calculated to materialize RIC on input: " << input << " is dynamic"; return; } auto output = input.get_source_output(); @@ -572,7 +573,7 @@ public: continue; } ric.set_can_be_fused(false); - NGRAPH_DEBUG << "Node is unsupported by RIC Fusion: " << *m.get_match_root() << std::endl; + OPENVINO_DEBUG << "Node is unsupported by RIC Fusion: " << *m.get_match_root() << std::endl; } } return true; diff --git a/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp b/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp index 62f794270e1..22b9d70dedc 100644 --- a/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp @@ -50,7 +50,9 @@ std::shared_ptr get_reduced_order_constant(const std::shared_p std::shared_ptr get_reversed_order_constant(const std::shared_ptr& order_const) { const auto& order = order_const->cast_vector(); const auto& rank = order.size(); + OPENVINO_SUPPRESS_DEPRECATED_START const auto& default_order = ngraph::get_default_order(rank); + OPENVINO_SUPPRESS_DEPRECATED_END std::vector reverse_order(rank); for (size_t i = 0; i < rank; ++i) reverse_order[order[i]] = default_order[i]; diff --git a/src/common/transformations/src/transformations/control_flow/unroll_tensor_iterator.cpp b/src/common/transformations/src/transformations/control_flow/unroll_tensor_iterator.cpp index b86f2625da2..93e637934d1 100644 --- a/src/common/transformations/src/transformations/control_flow/unroll_tensor_iterator.cpp +++ b/src/common/transformations/src/transformations/control_flow/unroll_tensor_iterator.cpp @@ -35,7 +35,7 @@ bool ov::pass::UnrollTensorIterator::run_on_model(const std::shared_ptr> body_functions(num_iter); for (int64_t idx = 0; idx < num_iter; ++idx) { - body_functions[idx] = ngraph::clone_function(*function); + body_functions[idx] = function->clone(); for (auto& node : body_functions[idx]->get_ops()) { node->set_friendly_name(sub_graph_op->get_friendly_name() + "/" + std::to_string(idx + 1) + "/" + node->get_friendly_name()); diff --git a/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp b/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp index 6e2eb438f5d..71e35396be0 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp @@ -16,6 +16,7 @@ #include "openvino/op/divide.hpp" #include "openvino/op/multiply.hpp" #include "openvino/op/power.hpp" +#include "openvino/util/log.hpp" #include "transformations/rt_info/nonconvertible_divide.hpp" #include "transformations/utils/utils.hpp" @@ -34,12 +35,12 @@ bool convert_divide(std::shared_ptr node) { if (std::dynamic_pointer_cast(div->get_input_node_shared_ptr(1))) { OPENVINO_SUPPRESS_DEPRECATED_START if (auto const_pow = ngraph::get_constant_from_source(pow)) { - OPENVINO_SUPPRESS_DEPRECATED_END pow = const_pow; } else { - NGRAPH_DEBUG << "ConvertDivide has failed due to unsupported evaluate type in " << pow.get(); + OPENVINO_DEBUG << "ConvertDivide has failed due to unsupported evaluate type in " << pow.get(); return false; } + OPENVINO_SUPPRESS_DEPRECATED_END } else { ngraph::copy_runtime_info(div, pow); } diff --git a/src/common/transformations/src/transformations/smart_reshape/mimic_set_batch_size.cpp b/src/common/transformations/src/transformations/smart_reshape/mimic_set_batch_size.cpp index 207fe3d9ebb..1a94a72b2f9 100644 --- a/src/common/transformations/src/transformations/smart_reshape/mimic_set_batch_size.cpp +++ b/src/common/transformations/src/transformations/smart_reshape/mimic_set_batch_size.cpp @@ -21,7 +21,7 @@ using namespace ngraph; bool ov::pass::MimicSetBatchSize::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(MimicSetBatchSize); // extracting ratio of out to in 0-index dimension value from the folded function - auto specialized_function = ngraph::clone_function(*f); + auto specialized_function = f->clone(); ngraph::pass::Manager manager; manager.register_pass(); manager.run_passes(specialized_function); diff --git a/src/common/transformations/tests/common_optimizations/add_fake_quantize_fusion.cpp b/src/common/transformations/tests/common_optimizations/add_fake_quantize_fusion.cpp index 116d7ba1be6..edc4e1315ec 100644 --- a/src/common/transformations/tests/common_optimizations/add_fake_quantize_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/add_fake_quantize_fusion.cpp @@ -230,7 +230,7 @@ TEST_F(TransformationTestsF, NegativeAddFakeQuantizeFusionLowPrecision) { auto output_high = opset5::Constant::create(element::f16, Shape{}, {10}); auto fq = std::make_shared(add, input_low, input_high, output_low, output_high, 11); function = std::make_shared(NodeVector{fq}, ParameterVector{data}); - function_ref = clone_function(*function); + function_ref = function->clone(); manager.register_pass(); } diff --git a/src/common/transformations/tests/common_optimizations/convert_quantize_dequantize.cpp b/src/common/transformations/tests/common_optimizations/convert_quantize_dequantize.cpp index 6d32e4ac352..2c1d54e3d47 100644 --- a/src/common/transformations/tests/common_optimizations/convert_quantize_dequantize.cpp +++ b/src/common/transformations/tests/common_optimizations/convert_quantize_dequantize.cpp @@ -37,13 +37,13 @@ std::shared_ptr create_q_dq_function(const Shape& data_shape, auto output_low = opset1::Constant::create(element::f32, Shape{}, {out_low}); auto output_high = opset1::Constant::create(element::f32, Shape{}, {out_high}); auto fq = std::make_shared(data, input_low, input_high, output_low, output_high, levels); - auto convert1 = std::make_shared(fq, element::from()); + auto convert1 = std::make_shared(fq, ov::element::from()); auto convert2 = std::make_shared(convert1, element::f32); const std::shared_ptr zero_point = - element::from() == element::f32 - ? opset1::Constant::create(element::from(), zero_point_shape, zero_point_values) + ov::element::from() == element::f32 + ? opset1::Constant::create(ov::element::from(), zero_point_shape, zero_point_values) : std::dynamic_pointer_cast(std::make_shared( - opset1::Constant::create(element::from(), zero_point_shape, zero_point_values), + opset1::Constant::create(ov::element::from(), zero_point_shape, zero_point_values), element::f32)); auto sub = std::make_shared(convert2, zero_point); auto scale = opset1::Constant::create(element::f32, scale_shape, scale_values); diff --git a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp index 91c6b048cfb..5dd3fbee41d 100644 --- a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp +++ b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp @@ -819,7 +819,7 @@ TEST(TransformationTests, LowLatencyLSTM_LLTv1_LLTv2) { auto res_ti_2 = std::make_shared(tensor_iterator->output(0)); f = std::make_shared(NodeVector{res_ti_1, res_ti_2}, ParameterVector{X, H_init, C_init}); - auto f_2 = ngraph::clone_function(*f); + auto f_2 = f->clone(); pass::Manager manager_2; manager_2.register_pass(); NGRAPH_SUPPRESS_DEPRECATED_START diff --git a/src/common/transformations/tests/common_optimizations/mul_fake_quantize_fusion.cpp b/src/common/transformations/tests/common_optimizations/mul_fake_quantize_fusion.cpp index 55c5e98e44a..306ac087947 100644 --- a/src/common/transformations/tests/common_optimizations/mul_fake_quantize_fusion.cpp +++ b/src/common/transformations/tests/common_optimizations/mul_fake_quantize_fusion.cpp @@ -170,7 +170,7 @@ TEST_F(TransformationTestsF, NegativeMulFakeQuantizeFusionLowPrecision) { auto output_high = opset5::Constant::create(element::f16, Shape{1}, {10}); auto fq = std::make_shared(mul, input_low, input_high, output_low, output_high, 11); function = std::make_shared(NodeVector{fq}, ParameterVector{data}); - function_ref = clone_function(*function); + function_ref = function->clone(); manager.register_pass(); } @@ -185,7 +185,7 @@ TEST_F(TransformationTestsF, NegativeMulFakeQuantizeFusionConstantAllNegative) { auto output_high = opset5::Constant::create(element::f32, Shape{1}, {10}); auto fq = std::make_shared(mul, input_low, input_high, output_low, output_high, 11); function = std::make_shared(NodeVector{fq}, ParameterVector{data}); - function_ref = clone_function(*function); + function_ref = function->clone(); manager.register_pass(); } @@ -200,7 +200,7 @@ TEST_F(TransformationTestsF, NegativeMulFakeQuantizeFusionConstantSomeNegative) auto output_high = opset5::Constant::create(element::f32, Shape{1}, {10}); auto fq = std::make_shared(mul, input_low, input_high, output_low, output_high, 20); function = std::make_shared(NodeVector{fq}, ParameterVector{data}); - function_ref = clone_function(*function); + function_ref = function->clone(); manager.register_pass(); } diff --git a/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp b/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp index 7f4389d9b32..1d171447575 100644 --- a/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp +++ b/src/common/transformations/tests/common_optimizations/transpose_to_reshape_test.cpp @@ -205,7 +205,7 @@ TEST(TransformationTests, replace_transpose_with_reshape) { auto transpose = make_shared((multiout ? A1->output(0) : A1), perm); auto transpose1 = make_shared(transpose); auto baseline_f = make_shared(transpose1, ParameterVector{param}); - auto optimized_f = clone_function(*baseline_f); + auto optimized_f = baseline_f->clone(); auto unh = std::make_shared(); pass::Manager m; diff --git a/src/common/transformations/tests/prelu_fusion.cpp b/src/common/transformations/tests/prelu_fusion.cpp index ba878750cdd..8cd93384406 100644 --- a/src/common/transformations/tests/prelu_fusion.cpp +++ b/src/common/transformations/tests/prelu_fusion.cpp @@ -130,7 +130,7 @@ TEST_F(TransformationTestsF, PReluFusionFail) { manager.register_pass(); } - function_ref = ngraph::clone_function(*function); + function_ref = function->clone(); } TEST_F(TransformationTestsF, PReluFusionAbsSubMulMulAdd) { diff --git a/src/core/builder/src/builder/autobroadcast.cpp b/src/core/builder/src/builder/autobroadcast.cpp index e4694d5b2d5..ecfd79c2a43 100644 --- a/src/core/builder/src/builder/autobroadcast.cpp +++ b/src/core/builder/src/builder/autobroadcast.cpp @@ -26,7 +26,6 @@ numpy_autobroadcast_incompatible_shapes::numpy_autobroadcast_incompatible_shapes : ngraph_error(error_str(shape1, shape2)), m_shape1(shape1), m_shape2(shape2) {} -OPENVINO_SUPPRESS_DEPRECATED_END string numpy_autobroadcast_incompatible_shapes::error_str(const Shape& shape1, const Shape& shape2) { ostringstream os; @@ -34,6 +33,7 @@ string numpy_autobroadcast_incompatible_shapes::error_str(const Shape& shape1, c << " shape1=" << vector_to_string(shape1) << " shape2=" << vector_to_string(shape2); return os.str(); } +OPENVINO_SUPPRESS_DEPRECATED_END /// /// \brief Calculate the output shape of numpy-style broadcast operation for two diff --git a/src/core/builder/src/builder/make_constant.cpp b/src/core/builder/src/builder/make_constant.cpp index d61125c4c51..aea4bfd16b8 100644 --- a/src/core/builder/src/builder/make_constant.cpp +++ b/src/core/builder/src/builder/make_constant.cpp @@ -4,6 +4,7 @@ #include "ngraph/builder/make_constant.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { namespace builder { std::shared_ptr make_constant_from_double(const element::Type& type, const Shape& shape, double num) { diff --git a/src/core/include/ngraph/attribute_adapter.hpp b/src/core/include/ngraph/attribute_adapter.hpp index 28f60ed3229..80dd071420d 100644 --- a/src/core/include/ngraph/attribute_adapter.hpp +++ b/src/core/include/ngraph/attribute_adapter.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/attribute_visitor.hpp b/src/core/include/ngraph/attribute_visitor.hpp index 1d0a62218e9..b1b6d37956f 100644 --- a/src/core/include/ngraph/attribute_visitor.hpp +++ b/src/core/include/ngraph/attribute_visitor.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/axis_set.hpp b/src/core/include/ngraph/axis_set.hpp index 6d28032fa76..9eae0bf04be 100644 --- a/src/core/include/ngraph/axis_set.hpp +++ b/src/core/include/ngraph/axis_set.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/axis_vector.hpp b/src/core/include/ngraph/axis_vector.hpp index 8d2232b0bb7..83a3c43022c 100644 --- a/src/core/include/ngraph/axis_vector.hpp +++ b/src/core/include/ngraph/axis_vector.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/check.hpp b/src/core/include/ngraph/check.hpp index b28072f3768..860dab88eaa 100644 --- a/src/core/include/ngraph/check.hpp +++ b/src/core/include/ngraph/check.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/coordinate.hpp b/src/core/include/ngraph/coordinate.hpp index f053876cd6a..ea280a63b37 100644 --- a/src/core/include/ngraph/coordinate.hpp +++ b/src/core/include/ngraph/coordinate.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/coordinate_diff.hpp b/src/core/include/ngraph/coordinate_diff.hpp index 1f3af21ba03..46b73b486c2 100644 --- a/src/core/include/ngraph/coordinate_diff.hpp +++ b/src/core/include/ngraph/coordinate_diff.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/deprecated.hpp b/src/core/include/ngraph/deprecated.hpp index 729dda3503a..e6ed8371daa 100644 --- a/src/core/include/ngraph/deprecated.hpp +++ b/src/core/include/ngraph/deprecated.hpp @@ -4,9 +4,23 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/deprecated.hpp" #define NGRAPH_DEPRECATED(msg) OPENVINO_DEPRECATED(msg) #define NGRAPH_ENUM_DEPRECATED(msg) OPENVINO_ENUM_DEPRECATED(msg) #define NGRAPH_SUPPRESS_DEPRECATED_START OPENVINO_SUPPRESS_DEPRECATED_START #define NGRAPH_SUPPRESS_DEPRECATED_END OPENVINO_SUPPRESS_DEPRECATED_END +#define NGRAPH_API_DEPRECATED \ + OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 2024.0 release. " \ + "For instructions on transitioning to the new API, please refer to " \ + "https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") diff --git a/src/core/include/ngraph/descriptor/input.hpp b/src/core/include/ngraph/descriptor/input.hpp index a8af2dae3a8..f4966373085 100644 --- a/src/core/include/ngraph/descriptor/input.hpp +++ b/src/core/include/ngraph/descriptor/input.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/descriptor/output.hpp b/src/core/include/ngraph/descriptor/output.hpp index a2b94b3b941..3e26c8941ac 100644 --- a/src/core/include/ngraph/descriptor/output.hpp +++ b/src/core/include/ngraph/descriptor/output.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/descriptor/tensor.hpp b/src/core/include/ngraph/descriptor/tensor.hpp index ff8eb2e9f3f..f26db08e343 100644 --- a/src/core/include/ngraph/descriptor/tensor.hpp +++ b/src/core/include/ngraph/descriptor/tensor.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/dimension.hpp b/src/core/include/ngraph/dimension.hpp index dcd2c8c8954..2c87e3377fe 100644 --- a/src/core/include/ngraph/dimension.hpp +++ b/src/core/include/ngraph/dimension.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/attribute_adapter.hpp" #include "ngraph/interval.hpp" #include "openvino/core/dimension.hpp" diff --git a/src/core/include/ngraph/distributed.hpp b/src/core/include/ngraph/distributed.hpp index e6412ee2a7a..6a07b09882e 100644 --- a/src/core/include/ngraph/distributed.hpp +++ b/src/core/include/ngraph/distributed.hpp @@ -4,11 +4,22 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include #include "ngraph/attribute_visitor.hpp" +#include "ngraph/deprecated.hpp" #include "ngraph/type.hpp" #include "ngraph/type/element_type.hpp" @@ -21,10 +32,7 @@ enum class Type { MAX, }; -NGRAPH_SUPPRESS_DEPRECATED_START -NGRAPH_API -std::ostream& operator<<(std::ostream& out, const Type& obj); -NGRAPH_SUPPRESS_DEPRECATED_END +NGRAPH_API_DEPRECATED NGRAPH_API std::ostream& operator<<(std::ostream& out, const Type& obj); } // namespace reduction } // namespace ngraph @@ -32,7 +40,8 @@ NGRAPH_SUPPRESS_DEPRECATED_END namespace ov { template <> -class NGRAPH_API AttributeAdapter : public EnumAttributeAdapterBase { +class NGRAPH_API_DEPRECATED NGRAPH_API AttributeAdapter + : public EnumAttributeAdapterBase { public: AttributeAdapter(ngraph::reduction::Type& value) : EnumAttributeAdapterBase(value) {} diff --git a/src/core/include/ngraph/enum_names.hpp b/src/core/include/ngraph/enum_names.hpp index 575ce0dcd8b..637e7aa0e3e 100644 --- a/src/core/include/ngraph/enum_names.hpp +++ b/src/core/include/ngraph/enum_names.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/check.hpp" #include "openvino/core/enum_names.hpp" diff --git a/src/core/include/ngraph/env_util.hpp b/src/core/include/ngraph/env_util.hpp index 251d3d33672..b11947531dd 100644 --- a/src/core/include/ngraph/env_util.hpp +++ b/src/core/include/ngraph/env_util.hpp @@ -4,25 +4,35 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include +#include "ngraph/deprecated.hpp" + namespace ngraph { /// \brief Get the names environment variable as a string. /// \param env_var The string name of the environment variable to get. /// \return Returns string by value or an empty string if the environment /// variable is not set. -NGRAPH_API -std::string getenv_string(const char* env_var); +NGRAPH_API_DEPRECATED NGRAPH_API std::string getenv_string(const char* env_var); /// \brief Get the names environment variable as an integer. If the value is not a /// valid integer then an exception is thrown. /// \param env_var The string name of the environment variable to get. /// \param default_value The value to return if the environment variable is not set. /// \return Returns value or default_value if the environment variable is not set. -NGRAPH_API -int32_t getenv_int(const char* env_var, int32_t default_value = -1); +NGRAPH_API_DEPRECATED NGRAPH_API int32_t getenv_int(const char* env_var, int32_t default_value = -1); /// \brief Get the names environment variable as a boolean. If the value is not a /// valid boolean then an exception is thrown. Valid booleans are one of @@ -32,6 +42,5 @@ int32_t getenv_int(const char* env_var, int32_t default_value = -1); /// \param env_var The string name of the environment variable to get. /// \param default_value The value to return if the environment variable is not set. /// \return Returns the boolean value of the environment variable. -NGRAPH_API -bool getenv_bool(const char* env_var, bool default_value = false); +NGRAPH_API_DEPRECATED NGRAPH_API bool getenv_bool(const char* env_var, bool default_value = false); } // namespace ngraph diff --git a/src/core/include/ngraph/evaluator.hpp b/src/core/include/ngraph/evaluator.hpp index d77503caefc..486b3135ad3 100644 --- a/src/core/include/ngraph/evaluator.hpp +++ b/src/core/include/ngraph/evaluator.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -18,7 +28,7 @@ namespace ngraph { /// /// template -class NGRAPH_DEPRECATED("This class is deprecated and will be removed soon.") Evaluator { +class NGRAPH_API_DEPRECATED Evaluator { NGRAPH_SUPPRESS_DEPRECATED_START public: /// \brief values we compute for outputs diff --git a/src/core/include/ngraph/except.hpp b/src/core/include/ngraph/except.hpp index e8eaeb050f3..1f8b2e2b730 100644 --- a/src/core/include/ngraph/except.hpp +++ b/src/core/include/ngraph/except.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -15,8 +25,7 @@ namespace ngraph { /// Base error for ngraph runtime errors. using ngraph_error = ov::Exception; -class NGRAPH_DEPRECATED("This class is deprecated and will be removed soon.") NGRAPH_API unsupported_op - : public std::runtime_error { +class NGRAPH_API_DEPRECATED NGRAPH_API unsupported_op : public std::runtime_error { public: unsupported_op(const std::string& what_arg) : std::runtime_error(what_arg) {} }; diff --git a/src/core/include/ngraph/factory.hpp b/src/core/include/ngraph/factory.hpp index 6ec8b9a911b..b30db51c262 100644 --- a/src/core/include/ngraph/factory.hpp +++ b/src/core/include/ngraph/factory.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -11,8 +21,9 @@ #include "ngraph/deprecated.hpp" #include "ngraph/ngraph_visibility.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { -NGRAPH_API std::mutex& get_registry_mutex(); +NGRAPH_API_DEPRECATED NGRAPH_API std::mutex& get_registry_mutex(); /// \brief Registry of factories that can construct objects derived from BASE_TYPE template @@ -29,6 +40,8 @@ public: }; } + ~FactoryRegistry() = default; + /// \brief Register a custom factory for type_info void register_factory(const typename BASE_TYPE::type_info_t& type_info, Factory factory) { std::lock_guard guard(get_registry_mutex()); @@ -76,3 +89,4 @@ protected: FactoryMap m_factory_map; }; } // namespace ngraph +NGRAPH_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/factory_adapter.hpp b/src/core/include/ngraph/factory_adapter.hpp index 1053108bff0..522a133853a 100644 --- a/src/core/include/ngraph/factory_adapter.hpp +++ b/src/core/include/ngraph/factory_adapter.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/attribute_adapter.hpp" #include "ngraph/attribute_visitor.hpp" #include "ngraph/deprecated.hpp" @@ -12,8 +22,7 @@ namespace ngraph { template -class NGRAPH_DEPRECATED("This class is deprecated and will be removed soon.") FactoryAttributeAdapter - : public VisitorAdapter { +class NGRAPH_API_DEPRECATED FactoryAttributeAdapter : public VisitorAdapter { public: FactoryAttributeAdapter(std::shared_ptr& ref) : m_ref(ref) {} diff --git a/src/core/include/ngraph/file_util.hpp b/src/core/include/ngraph/file_util.hpp index 2b6e98ce419..17dca7d1322 100644 --- a/src/core/include/ngraph/file_util.hpp +++ b/src/core/include/ngraph/file_util.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -15,32 +25,32 @@ namespace ngraph { namespace file_util { /// \brief Returns the name with extension for a given path /// \param path The path to the output file -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string get_file_name(const std::string& path); /// \brief Returns the file extension /// \param path The path to the output file -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string get_file_ext(const std::string& path); /// \brief Returns the directory portion of the given path /// \param path The path to the output file -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string get_directory(const std::string& path); /// \brief Joins multiple paths into a single path /// \param s1 Left side of path /// \param s2 Right side of path -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string path_join(const std::string& s1, const std::string& s2); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string path_join(const std::string& s1, const std::string& s2, const std::string& s3); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string path_join(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4); @@ -48,7 +58,7 @@ std::string path_join(const std::string& s1, const std::string& s2, const std::s /// \param path The path to iterate over /// \param func A callback function called with each file or directory encountered /// \param recurse Optional parameter to enable recursing through path -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API void iterate_files(const std::string& path, std::function func, @@ -57,25 +67,25 @@ void iterate_files(const std::string& path, /// \brief Change Linux-style path ('/') to Windows-style ('\\') /// \param path The path to change file separator -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API void convert_path_win_style(std::string& path); /// \brief Conversion from wide character string to a single-byte chain. /// \param wstr A wide-char string /// \return A multi-byte string -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string wstring_to_string(const std::wstring& wstr); /// \brief Conversion from single-byte chain to wide character string. /// \param str A null-terminated string /// \return A wide-char string -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::wstring multi_byte_char_to_wstring(const char* str); /// \brief Remove path components which would allow traversing up a directory tree. /// \param path A path to file /// \return A sanitiazed path -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::string sanitize_path(const std::string& path); } // namespace file_util } // namespace ngraph diff --git a/src/core/include/ngraph/function.hpp b/src/core/include/ngraph/function.hpp index 85e2ec3cf7f..22751834911 100644 --- a/src/core/include/ngraph/function.hpp +++ b/src/core/include/ngraph/function.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ngraph_visibility.hpp" #include "ngraph/node.hpp" #include "ngraph/op/assign.hpp" diff --git a/src/core/include/ngraph/graph_util.hpp b/src/core/include/ngraph/graph_util.hpp index b190434d69b..e22c17bab81 100644 --- a/src/core/include/ngraph/graph_util.hpp +++ b/src/core/include/ngraph/graph_util.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -36,12 +46,14 @@ using ov::op::v0::Result; } // namespace v0 } // namespace op +NGRAPH_API_DEPRECATED inline std::shared_ptr clone_function(const ngraph::Function& func, ngraph::NodeMap& node_map) { OPENVINO_SUPPRESS_DEPRECATED_START return ov::clone_model(func, node_map); OPENVINO_SUPPRESS_DEPRECATED_END } +NGRAPH_API_DEPRECATED inline std::shared_ptr clone_function(const ngraph::Function& func) { OPENVINO_SUPPRESS_DEPRECATED_START return ov::clone_model(func); @@ -56,13 +68,13 @@ using ov::replace_output_update_name; using ov::topological_sort; using ov::traverse_nodes; -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API NodeVector find_common_args(std::shared_ptr target, std::shared_ptr replacement); /// Topological sort of just nodes template -std::vector> subgraph_topological_sort(T nodes) { +NGRAPH_API_DEPRECATED std::vector> subgraph_topological_sort(T nodes) { std::stack> nodes_to_do; std::unordered_set nodes_done; std::unordered_set nodes_to_emit; @@ -111,24 +123,25 @@ std::vector> subgraph_topological_sort(T nodes) { } template -void validate_nodes_and_infer_types(const T& nodes) { +NGRAPH_API_DEPRECATED void validate_nodes_and_infer_types(const T& nodes) { for (auto& node : subgraph_topological_sort(nodes)) { node->revalidate_and_infer_types(); } } // Check if all paths from X to a result go through Y -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_post_dominated(Node* X, Node* Y); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_equal_to_const_value(const std::string& const_value, const Output& reduce_constant); // input nodes are cloned and returned // NodeMap input may contain default node mapping i.e. pre-cloned nodes // NodeMap output (by reference) fully maps input and cloned nodes +NGRAPH_API_DEPRECATED NGRAPH_API std::vector> clone_nodes(const std::vector>& nodes, NodeMap& node_map); @@ -136,34 +149,36 @@ std::vector> clone_nodes(const std::vector> clone_nodes(const std::vector>& nodes, RawNodeOutputMap& node_map); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::pair, std::shared_ptr> insert_result_parameter_split( const std::shared_ptr& src_node, const std::shared_ptr& dst_node); +NGRAPH_API_DEPRECATED NGRAPH_API void insert_new_node_between(const std::shared_ptr& src_node, const std::shared_ptr& dst_node, const std::shared_ptr& new_node); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr make_zero(const element::Type& element_type, const Shape& shape); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr make_constant_from_string(std::string val, const element::Type& element_type, const Shape& shape); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_zero(const Output& reduce_constant); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API NodeVector get_subgraph_outputs(const NodeVector& nodes, const NodeVector& exclusions, @@ -173,32 +188,34 @@ NodeVector get_subgraph_outputs(const NodeVector& nodes, // Extract sub-graph computing the `results`. Stops backward traversal at either a Parameter // node // or a node that belongs to args +NGRAPH_API_DEPRECATED NGRAPH_API NodeVector extract_subgraph(const NodeVector& results, const NodeVector& args); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_one(const Output& reduce_constant); // Returns true if `node` is live in the graph i.e. a result op // transitively uses this `node` +NGRAPH_API_DEPRECATED NGRAPH_API bool is_used(Node* node); // Returns count of `node` users that are still live in the graph -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API size_t get_user_count(Node* node); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_strided(const Strides& strides); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool is_valid_rank(const std::shared_ptr& node, std::vector valid_ranks); -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API void plot_graph(std::shared_ptr f, const std::string& filename, @@ -206,19 +223,19 @@ void plot_graph(std::shared_ptr f, /// \return A vector containing handles for each input of dst that is connected to an output /// of `src`. -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::vector> get_inputs_from(Node& src, Node& dst); /// \return A vector containing a handle for each output of src that is connected to an input /// of `dst`. -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API std::vector> get_outputs_to(Node& src, Node& dst); /// Checks the func for graph cycles starting from results going backwards, then from parameters /// going forward. /// It returns true if a cycle is found and the first cycle encountered. -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED NGRAPH_API bool check_for_cycles(const ngraph::Function* func, ngraph::NodeVector& cycle_nodes, bool& is_bkwd_cycle); } // namespace ngraph diff --git a/src/core/include/ngraph/interval.hpp b/src/core/include/ngraph/interval.hpp index 4cfdafc4cfd..a40439758aa 100644 --- a/src/core/include/ngraph/interval.hpp +++ b/src/core/include/ngraph/interval.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/interval.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/log.hpp b/src/core/include/ngraph/log.hpp index 2828ca06d8d..b1d2f4a4c27 100644 --- a/src/core/include/ngraph/log.hpp +++ b/src/core/include/ngraph/log.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -19,8 +29,11 @@ #include #include +#include "ngraph/deprecated.hpp" + +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { -class ConstString { +class NGRAPH_API_DEPRECATED ConstString { public: template constexpr ConstString(const char (&p)[SIZE]) : m_string(p), @@ -41,17 +54,21 @@ private: size_t m_size; }; +NGRAPH_API_DEPRECATED constexpr const char* find_last(ConstString s, size_t offset, char ch) { return offset == 0 ? s.get_ptr(0) : (s[offset] == ch ? s.get_ptr(offset + 1) : find_last(s, offset - 1, ch)); } +NGRAPH_API_DEPRECATED constexpr const char* find_last(ConstString s, char ch) { return find_last(s, s.size() - 1, ch); } +NGRAPH_API_DEPRECATED constexpr const char* get_file_name(ConstString s) { return find_last(s, '/'); } +NGRAPH_API_DEPRECATED constexpr const char* trim_file_name(ConstString root, ConstString s) { return s.get_ptr(root.size()); } @@ -62,7 +79,7 @@ enum class LOG_TYPE { _LOG_TYPE_DEBUG, }; -class NGRAPH_API LogHelper { +class NGRAPH_API_DEPRECATED NGRAPH_API LogHelper { public: LogHelper(LOG_TYPE, const char* file, int line, std::function m_handler_func); ~LogHelper(); @@ -76,7 +93,7 @@ private: std::stringstream m_stream; }; -class Logger { +class NGRAPH_API_DEPRECATED Logger { friend class LogHelper; public: @@ -92,12 +109,14 @@ private: static std::deque m_queue; }; +NGRAPH_API_DEPRECATED NGRAPH_API void default_logger_handler_func(const std::string& s); #ifndef PROJECT_ROOT_DIR # define PROJECT_ROOT_DIR "" #endif +NGRAPH_SUPPRESS_DEPRECATED_END #define NGRAPH_ERR \ ngraph::LogHelper(ngraph::LOG_TYPE::_LOG_TYPE_ERROR, \ diff --git a/src/core/include/ngraph/ngraph.hpp b/src/core/include/ngraph/ngraph.hpp index 0da1c9a7dc0..4d51c440783 100644 --- a/src/core/include/ngraph/ngraph.hpp +++ b/src/core/include/ngraph/ngraph.hpp @@ -8,6 +8,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/deprecated.hpp" diff --git a/src/core/include/ngraph/ngraph_visibility.hpp b/src/core/include/ngraph/ngraph_visibility.hpp index 05acb51c3d4..f2b2e18b344 100644 --- a/src/core/include/ngraph/ngraph_visibility.hpp +++ b/src/core/include/ngraph/ngraph_visibility.hpp @@ -1,6 +1,17 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once + +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif #include "ngraph/visibility.hpp" #include "openvino/core/core_visibility.hpp" diff --git a/src/core/include/ngraph/node.hpp b/src/core/include/ngraph/node.hpp index 76090d3cca3..5943799262e 100644 --- a/src/core/include/ngraph/node.hpp +++ b/src/core/include/ngraph/node.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -69,8 +79,10 @@ using ResultVector = std::vector>; const auto node_validation_failure_loc_string = ov::node_validation_failure_loc_string; NGRAPH_API +NGRAPH_API_DEPRECATED const std::shared_ptr& check_single_output_arg(const std::shared_ptr& node, size_t i); NGRAPH_API +NGRAPH_API_DEPRECATED const NodeVector& check_single_output_args(const NodeVector& args); const auto as_output_vector = ov::as_output_vector; diff --git a/src/core/include/ngraph/node_input.hpp b/src/core/include/ngraph/node_input.hpp index d3a50db7f56..37c6678de74 100644 --- a/src/core/include/ngraph/node_input.hpp +++ b/src/core/include/ngraph/node_input.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/node_output.hpp b/src/core/include/ngraph/node_output.hpp index 58ec1cc7098..4786b52f347 100644 --- a/src/core/include/ngraph/node_output.hpp +++ b/src/core/include/ngraph/node_output.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/abs.hpp b/src/core/include/ngraph/op/abs.hpp index 2276e29e0ad..ab96e5d413b 100644 --- a/src/core/include/ngraph/op/abs.hpp +++ b/src/core/include/ngraph/op/abs.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/acos.hpp b/src/core/include/ngraph/op/acos.hpp index 92c38ee6767..f3173555f3a 100644 --- a/src/core/include/ngraph/op/acos.hpp +++ b/src/core/include/ngraph/op/acos.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/acosh.hpp b/src/core/include/ngraph/op/acosh.hpp index d9132658263..677fab4f318 100644 --- a/src/core/include/ngraph/op/acosh.hpp +++ b/src/core/include/ngraph/op/acosh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/adaptive_avg_pool.hpp b/src/core/include/ngraph/op/adaptive_avg_pool.hpp index 40028ce44b3..25e4a9976ee 100644 --- a/src/core/include/ngraph/op/adaptive_avg_pool.hpp +++ b/src/core/include/ngraph/op/adaptive_avg_pool.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/adaptive_avg_pool.hpp" diff --git a/src/core/include/ngraph/op/adaptive_max_pool.hpp b/src/core/include/ngraph/op/adaptive_max_pool.hpp index 8c8594795b3..1298dc97a2f 100644 --- a/src/core/include/ngraph/op/adaptive_max_pool.hpp +++ b/src/core/include/ngraph/op/adaptive_max_pool.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/adaptive_max_pool.hpp" diff --git a/src/core/include/ngraph/op/add.hpp b/src/core/include/ngraph/op/add.hpp index b849aa24275..61584b5138f 100644 --- a/src/core/include/ngraph/op/add.hpp +++ b/src/core/include/ngraph/op/add.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/and.hpp b/src/core/include/ngraph/op/and.hpp index c49aafec1bd..3ce521f8c60 100644 --- a/src/core/include/ngraph/op/and.hpp +++ b/src/core/include/ngraph/op/and.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/binary_elementwise_logical.hpp" diff --git a/src/core/include/ngraph/op/asin.hpp b/src/core/include/ngraph/op/asin.hpp index 1ebab975d00..4ef7fb119d7 100644 --- a/src/core/include/ngraph/op/asin.hpp +++ b/src/core/include/ngraph/op/asin.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/asinh.hpp b/src/core/include/ngraph/op/asinh.hpp index 08143f2cc50..0f40a770a3f 100644 --- a/src/core/include/ngraph/op/asinh.hpp +++ b/src/core/include/ngraph/op/asinh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/assign.hpp b/src/core/include/ngraph/op/assign.hpp index 9afffc68729..af479f8bae8 100644 --- a/src/core/include/ngraph/op/assign.hpp +++ b/src/core/include/ngraph/op/assign.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/sink.hpp" #include "ngraph/op/util/variable.hpp" #include "ngraph/op/util/variable_extension.hpp" diff --git a/src/core/include/ngraph/op/atan.hpp b/src/core/include/ngraph/op/atan.hpp index 6ed5beca239..4cc94c1709d 100644 --- a/src/core/include/ngraph/op/atan.hpp +++ b/src/core/include/ngraph/op/atan.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/atanh.hpp b/src/core/include/ngraph/op/atanh.hpp index 004e93ef645..03b4454b5cf 100644 --- a/src/core/include/ngraph/op/atanh.hpp +++ b/src/core/include/ngraph/op/atanh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/avg_pool.hpp b/src/core/include/ngraph/op/avg_pool.hpp index 4bc2359d5d4..180787b42d6 100644 --- a/src/core/include/ngraph/op/avg_pool.hpp +++ b/src/core/include/ngraph/op/avg_pool.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/avg_pool.hpp" diff --git a/src/core/include/ngraph/op/batch_norm.hpp b/src/core/include/ngraph/op/batch_norm.hpp index 8f64f8cb188..cac36e5b4e2 100644 --- a/src/core/include/ngraph/op/batch_norm.hpp +++ b/src/core/include/ngraph/op/batch_norm.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/op/batch_to_space.hpp b/src/core/include/ngraph/op/batch_to_space.hpp index 4b7a156315a..da115a4c038 100644 --- a/src/core/include/ngraph/op/batch_to_space.hpp +++ b/src/core/include/ngraph/op/batch_to_space.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/batch_to_space.hpp" diff --git a/src/core/include/ngraph/op/binary_convolution.hpp b/src/core/include/ngraph/op/binary_convolution.hpp index fe437442c5b..a51e91549b6 100644 --- a/src/core/include/ngraph/op/binary_convolution.hpp +++ b/src/core/include/ngraph/op/binary_convolution.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/broadcast.hpp b/src/core/include/ngraph/op/broadcast.hpp index cd8858db8f2..98c0ac86da5 100644 --- a/src/core/include/ngraph/op/broadcast.hpp +++ b/src/core/include/ngraph/op/broadcast.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/bucketize.hpp b/src/core/include/ngraph/op/bucketize.hpp index 61725f26860..052d0d13ebc 100644 --- a/src/core/include/ngraph/op/bucketize.hpp +++ b/src/core/include/ngraph/op/bucketize.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/bucketize.hpp" diff --git a/src/core/include/ngraph/op/ceiling.hpp b/src/core/include/ngraph/op/ceiling.hpp index fd283e94bf9..e5c061a4c3e 100644 --- a/src/core/include/ngraph/op/ceiling.hpp +++ b/src/core/include/ngraph/op/ceiling.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/ceiling.hpp" diff --git a/src/core/include/ngraph/op/clamp.hpp b/src/core/include/ngraph/op/clamp.hpp index a6143783d91..64a3c2f39f1 100644 --- a/src/core/include/ngraph/op/clamp.hpp +++ b/src/core/include/ngraph/op/clamp.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/clamp.hpp" diff --git a/src/core/include/ngraph/op/concat.hpp b/src/core/include/ngraph/op/concat.hpp index 4e812072619..0c509cc057a 100644 --- a/src/core/include/ngraph/op/concat.hpp +++ b/src/core/include/ngraph/op/concat.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/constant.hpp b/src/core/include/ngraph/op/constant.hpp index ac8a5b45570..e1034db162b 100644 --- a/src/core/include/ngraph/op/constant.hpp +++ b/src/core/include/ngraph/op/constant.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/convert.hpp b/src/core/include/ngraph/op/convert.hpp index ac9d0a0f3bb..8db87dda012 100644 --- a/src/core/include/ngraph/op/convert.hpp +++ b/src/core/include/ngraph/op/convert.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "openvino/op/convert.hpp" diff --git a/src/core/include/ngraph/op/convert_like.hpp b/src/core/include/ngraph/op/convert_like.hpp index 760fbae3520..60e14bd4a9f 100644 --- a/src/core/include/ngraph/op/convert_like.hpp +++ b/src/core/include/ngraph/op/convert_like.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/convert_like.hpp" diff --git a/src/core/include/ngraph/op/convolution.hpp b/src/core/include/ngraph/op/convolution.hpp index e4ed70fac10..3c5c9bab1f9 100644 --- a/src/core/include/ngraph/op/convolution.hpp +++ b/src/core/include/ngraph/op/convolution.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/cos.hpp b/src/core/include/ngraph/op/cos.hpp index f1de94cff92..af59b80a9af 100644 --- a/src/core/include/ngraph/op/cos.hpp +++ b/src/core/include/ngraph/op/cos.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/cos.hpp" diff --git a/src/core/include/ngraph/op/cosh.hpp b/src/core/include/ngraph/op/cosh.hpp index 552b2cec5db..d2c7b8f340a 100644 --- a/src/core/include/ngraph/op/cosh.hpp +++ b/src/core/include/ngraph/op/cosh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/cosh.hpp" diff --git a/src/core/include/ngraph/op/ctc_greedy_decoder.hpp b/src/core/include/ngraph/op/ctc_greedy_decoder.hpp index 5a574e9b70b..365406cb2a5 100644 --- a/src/core/include/ngraph/op/ctc_greedy_decoder.hpp +++ b/src/core/include/ngraph/op/ctc_greedy_decoder.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/ctc_greedy_decoder.hpp" diff --git a/src/core/include/ngraph/op/ctc_greedy_decoder_seq_len.hpp b/src/core/include/ngraph/op/ctc_greedy_decoder_seq_len.hpp index c885f35d423..a2ec282688d 100644 --- a/src/core/include/ngraph/op/ctc_greedy_decoder_seq_len.hpp +++ b/src/core/include/ngraph/op/ctc_greedy_decoder_seq_len.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/ctc_greedy_decoder_seq_len.hpp" diff --git a/src/core/include/ngraph/op/ctc_loss.hpp b/src/core/include/ngraph/op/ctc_loss.hpp index b56d3d3607d..36e25d5f7b1 100644 --- a/src/core/include/ngraph/op/ctc_loss.hpp +++ b/src/core/include/ngraph/op/ctc_loss.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/ctc_loss.hpp" diff --git a/src/core/include/ngraph/op/cum_sum.hpp b/src/core/include/ngraph/op/cum_sum.hpp index c8630214430..2ecd5bd4f13 100644 --- a/src/core/include/ngraph/op/cum_sum.hpp +++ b/src/core/include/ngraph/op/cum_sum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/cum_sum.hpp" diff --git a/src/core/include/ngraph/op/deformable_convolution.hpp b/src/core/include/ngraph/op/deformable_convolution.hpp index 1714272bf88..2ef161637dd 100644 --- a/src/core/include/ngraph/op/deformable_convolution.hpp +++ b/src/core/include/ngraph/op/deformable_convolution.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/deformable_psroi_pooling.hpp b/src/core/include/ngraph/op/deformable_psroi_pooling.hpp index dd0a828aa78..1a561fbb20e 100644 --- a/src/core/include/ngraph/op/deformable_psroi_pooling.hpp +++ b/src/core/include/ngraph/op/deformable_psroi_pooling.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/deformable_psroi_pooling.hpp" diff --git a/src/core/include/ngraph/op/depth_to_space.hpp b/src/core/include/ngraph/op/depth_to_space.hpp index 6f8a2995079..0f2e4341968 100644 --- a/src/core/include/ngraph/op/depth_to_space.hpp +++ b/src/core/include/ngraph/op/depth_to_space.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/depth_to_space.hpp" diff --git a/src/core/include/ngraph/op/detection_output.hpp b/src/core/include/ngraph/op/detection_output.hpp index cf15e829ca7..9c60638c8e3 100644 --- a/src/core/include/ngraph/op/detection_output.hpp +++ b/src/core/include/ngraph/op/detection_output.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/detection_output.hpp" diff --git a/src/core/include/ngraph/op/dft.hpp b/src/core/include/ngraph/op/dft.hpp index 1b3364c263a..fe94ae91fc4 100644 --- a/src/core/include/ngraph/op/dft.hpp +++ b/src/core/include/ngraph/op/dft.hpp @@ -16,6 +16,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/divide.hpp b/src/core/include/ngraph/op/divide.hpp index 85d19182261..8ad23dc0b3c 100644 --- a/src/core/include/ngraph/op/divide.hpp +++ b/src/core/include/ngraph/op/divide.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/divide.hpp" diff --git a/src/core/include/ngraph/op/einsum.hpp b/src/core/include/ngraph/op/einsum.hpp index 88c67d364c4..8dd7eaa14a1 100644 --- a/src/core/include/ngraph/op/einsum.hpp +++ b/src/core/include/ngraph/op/einsum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/einsum.hpp" diff --git a/src/core/include/ngraph/op/elu.hpp b/src/core/include/ngraph/op/elu.hpp index 2eeb3ff797c..501f6689f9c 100644 --- a/src/core/include/ngraph/op/elu.hpp +++ b/src/core/include/ngraph/op/elu.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/elu.hpp" diff --git a/src/core/include/ngraph/op/embedding_segments_sum.hpp b/src/core/include/ngraph/op/embedding_segments_sum.hpp index a9404c3be13..1eb8282815c 100644 --- a/src/core/include/ngraph/op/embedding_segments_sum.hpp +++ b/src/core/include/ngraph/op/embedding_segments_sum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/index_reduction.hpp" #include "openvino/op/embedding_segments_sum.hpp" diff --git a/src/core/include/ngraph/op/embeddingbag_offsets_sum.hpp b/src/core/include/ngraph/op/embeddingbag_offsets_sum.hpp index 6be2f09afa2..48d4a3c298d 100644 --- a/src/core/include/ngraph/op/embeddingbag_offsets_sum.hpp +++ b/src/core/include/ngraph/op/embeddingbag_offsets_sum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/embeddingbag_offsets_base.hpp" #include "ngraph/op/util/index_reduction.hpp" diff --git a/src/core/include/ngraph/op/embeddingbag_packedsum.hpp b/src/core/include/ngraph/op/embeddingbag_packedsum.hpp index 9791e320fee..2bcbe580129 100644 --- a/src/core/include/ngraph/op/embeddingbag_packedsum.hpp +++ b/src/core/include/ngraph/op/embeddingbag_packedsum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/embeddingbag_packed_base.hpp" #include "ngraph/op/util/index_reduction.hpp" diff --git a/src/core/include/ngraph/op/equal.hpp b/src/core/include/ngraph/op/equal.hpp index c0736a052d9..69ca75b677b 100644 --- a/src/core/include/ngraph/op/equal.hpp +++ b/src/core/include/ngraph/op/equal.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/equal.hpp" diff --git a/src/core/include/ngraph/op/erf.hpp b/src/core/include/ngraph/op/erf.hpp index 2ae6f9e1b9b..04669af7b7b 100644 --- a/src/core/include/ngraph/op/erf.hpp +++ b/src/core/include/ngraph/op/erf.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/erf.hpp" diff --git a/src/core/include/ngraph/op/exp.hpp b/src/core/include/ngraph/op/exp.hpp index c7c3e5b40bb..582fb434af2 100644 --- a/src/core/include/ngraph/op/exp.hpp +++ b/src/core/include/ngraph/op/exp.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/exp.hpp" diff --git a/src/core/include/ngraph/op/experimental_detectron_detection_output.hpp b/src/core/include/ngraph/op/experimental_detectron_detection_output.hpp index 498ddc3ce7c..32396876379 100644 --- a/src/core/include/ngraph/op/experimental_detectron_detection_output.hpp +++ b/src/core/include/ngraph/op/experimental_detectron_detection_output.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp b/src/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp index f79c423584b..e063f6f9380 100644 --- a/src/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp +++ b/src/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp b/src/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp index abea38b9e7e..3a7e8624182 100644 --- a/src/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp +++ b/src/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/experimental_detectron_roi_feature.hpp b/src/core/include/ngraph/op/experimental_detectron_roi_feature.hpp index d1d2336da4e..98eeef604d0 100644 --- a/src/core/include/ngraph/op/experimental_detectron_roi_feature.hpp +++ b/src/core/include/ngraph/op/experimental_detectron_roi_feature.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/experimental_detectron_topkrois.hpp b/src/core/include/ngraph/op/experimental_detectron_topkrois.hpp index fe97cc856a3..6b41bbece97 100644 --- a/src/core/include/ngraph/op/experimental_detectron_topkrois.hpp +++ b/src/core/include/ngraph/op/experimental_detectron_topkrois.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/extractimagepatches.hpp b/src/core/include/ngraph/op/extractimagepatches.hpp index cafc4525121..f4c33abd174 100644 --- a/src/core/include/ngraph/op/extractimagepatches.hpp +++ b/src/core/include/ngraph/op/extractimagepatches.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/extractimagepatches.hpp" diff --git a/src/core/include/ngraph/op/eye.hpp b/src/core/include/ngraph/op/eye.hpp index 14bd42e3f33..8bb108edb64 100644 --- a/src/core/include/ngraph/op/eye.hpp +++ b/src/core/include/ngraph/op/eye.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/fake_quantize.hpp b/src/core/include/ngraph/op/fake_quantize.hpp index fa923ad838f..6a2c34531ea 100644 --- a/src/core/include/ngraph/op/fake_quantize.hpp +++ b/src/core/include/ngraph/op/fake_quantize.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/floor.hpp b/src/core/include/ngraph/op/floor.hpp index 75067caf283..c0c7d8f3c16 100644 --- a/src/core/include/ngraph/op/floor.hpp +++ b/src/core/include/ngraph/op/floor.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/floor.hpp" diff --git a/src/core/include/ngraph/op/floor_mod.hpp b/src/core/include/ngraph/op/floor_mod.hpp index 2db7394c2be..03d5d4dd70f 100644 --- a/src/core/include/ngraph/op/floor_mod.hpp +++ b/src/core/include/ngraph/op/floor_mod.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/gather.hpp b/src/core/include/ngraph/op/gather.hpp index fa966ae0cf0..124e77f03ef 100644 --- a/src/core/include/ngraph/op/gather.hpp +++ b/src/core/include/ngraph/op/gather.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/gather_base.hpp" #include "openvino/op/gather.hpp" diff --git a/src/core/include/ngraph/op/gather_elements.hpp b/src/core/include/ngraph/op/gather_elements.hpp index d921af4d1de..77180e143af 100644 --- a/src/core/include/ngraph/op/gather_elements.hpp +++ b/src/core/include/ngraph/op/gather_elements.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/gather_elements.hpp" diff --git a/src/core/include/ngraph/op/gather_nd.hpp b/src/core/include/ngraph/op/gather_nd.hpp index 333a01844b0..fe587ff39e5 100644 --- a/src/core/include/ngraph/op/gather_nd.hpp +++ b/src/core/include/ngraph/op/gather_nd.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/gather_nd.hpp" diff --git a/src/core/include/ngraph/op/gather_tree.hpp b/src/core/include/ngraph/op/gather_tree.hpp index 7e24b86c09f..deead92748b 100644 --- a/src/core/include/ngraph/op/gather_tree.hpp +++ b/src/core/include/ngraph/op/gather_tree.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/gather_tree.hpp" diff --git a/src/core/include/ngraph/op/gelu.hpp b/src/core/include/ngraph/op/gelu.hpp index 062b8873ccf..d3f084c88b4 100644 --- a/src/core/include/ngraph/op/gelu.hpp +++ b/src/core/include/ngraph/op/gelu.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/generate_proposals.hpp b/src/core/include/ngraph/op/generate_proposals.hpp index 87ec34fda1a..3dc2525b198 100644 --- a/src/core/include/ngraph/op/generate_proposals.hpp +++ b/src/core/include/ngraph/op/generate_proposals.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/generate_proposals.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/greater.hpp b/src/core/include/ngraph/op/greater.hpp index 9f380c1dc6d..4869b67748e 100644 --- a/src/core/include/ngraph/op/greater.hpp +++ b/src/core/include/ngraph/op/greater.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/greater.hpp" diff --git a/src/core/include/ngraph/op/greater_eq.hpp b/src/core/include/ngraph/op/greater_eq.hpp index d1edbe5ad66..130ea97bc87 100644 --- a/src/core/include/ngraph/op/greater_eq.hpp +++ b/src/core/include/ngraph/op/greater_eq.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/greater_eq.hpp" diff --git a/src/core/include/ngraph/op/grid_sample.hpp b/src/core/include/ngraph/op/grid_sample.hpp index e1dd60a83c9..fe161bb9519 100644 --- a/src/core/include/ngraph/op/grid_sample.hpp +++ b/src/core/include/ngraph/op/grid_sample.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/grid_sample.hpp" diff --git a/src/core/include/ngraph/op/grn.hpp b/src/core/include/ngraph/op/grn.hpp index 4c32450da86..5073d8219ff 100644 --- a/src/core/include/ngraph/op/grn.hpp +++ b/src/core/include/ngraph/op/grn.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/group_conv.hpp b/src/core/include/ngraph/op/group_conv.hpp index f4fff5c12ab..bde389017e9 100644 --- a/src/core/include/ngraph/op/group_conv.hpp +++ b/src/core/include/ngraph/op/group_conv.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/convolution.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/gru_cell.hpp b/src/core/include/ngraph/op/gru_cell.hpp index e401f46d993..7eec4f1b285 100644 --- a/src/core/include/ngraph/op/gru_cell.hpp +++ b/src/core/include/ngraph/op/gru_cell.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/gru_sequence.hpp b/src/core/include/ngraph/op/gru_sequence.hpp index ddb262842b2..9713ddf7e64 100644 --- a/src/core/include/ngraph/op/gru_sequence.hpp +++ b/src/core/include/ngraph/op/gru_sequence.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/hard_sigmoid.hpp b/src/core/include/ngraph/op/hard_sigmoid.hpp index 5c6f446088a..170a1072461 100644 --- a/src/core/include/ngraph/op/hard_sigmoid.hpp +++ b/src/core/include/ngraph/op/hard_sigmoid.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/hard_sigmoid.hpp" diff --git a/src/core/include/ngraph/op/hsigmoid.hpp b/src/core/include/ngraph/op/hsigmoid.hpp index 8f20d15470c..31ec84fd265 100644 --- a/src/core/include/ngraph/op/hsigmoid.hpp +++ b/src/core/include/ngraph/op/hsigmoid.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/hswish.hpp b/src/core/include/ngraph/op/hswish.hpp index afeb5745954..4a75cb32f36 100644 --- a/src/core/include/ngraph/op/hswish.hpp +++ b/src/core/include/ngraph/op/hswish.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/i420_to_bgr.hpp b/src/core/include/ngraph/op/i420_to_bgr.hpp index aeb2671934a..7a0e25e615a 100644 --- a/src/core/include/ngraph/op/i420_to_bgr.hpp +++ b/src/core/include/ngraph/op/i420_to_bgr.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/i420_to_bgr.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/i420_to_rgb.hpp b/src/core/include/ngraph/op/i420_to_rgb.hpp index 61e63269c87..3f092d63739 100644 --- a/src/core/include/ngraph/op/i420_to_rgb.hpp +++ b/src/core/include/ngraph/op/i420_to_rgb.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/i420_to_rgb.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/idft.hpp b/src/core/include/ngraph/op/idft.hpp index c6b8b2c0b17..e85d127227d 100644 --- a/src/core/include/ngraph/op/idft.hpp +++ b/src/core/include/ngraph/op/idft.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/if.hpp b/src/core/include/ngraph/op/if.hpp index d53b5355e3d..f5ceab23b72 100644 --- a/src/core/include/ngraph/op/if.hpp +++ b/src/core/include/ngraph/op/if.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/function.hpp" diff --git a/src/core/include/ngraph/op/interpolate.hpp b/src/core/include/ngraph/op/interpolate.hpp index 62227b11eab..f0628802e24 100644 --- a/src/core/include/ngraph/op/interpolate.hpp +++ b/src/core/include/ngraph/op/interpolate.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/irdft.hpp b/src/core/include/ngraph/op/irdft.hpp index acb3c31e225..c9b69562824 100644 --- a/src/core/include/ngraph/op/irdft.hpp +++ b/src/core/include/ngraph/op/irdft.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/irdft.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/is_finite.hpp b/src/core/include/ngraph/op/is_finite.hpp index 7d0807a5d1c..af3773d6e92 100644 --- a/src/core/include/ngraph/op/is_finite.hpp +++ b/src/core/include/ngraph/op/is_finite.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/is_finite.hpp" diff --git a/src/core/include/ngraph/op/is_inf.hpp b/src/core/include/ngraph/op/is_inf.hpp index 200bb0d01ac..8e7b41d2191 100644 --- a/src/core/include/ngraph/op/is_inf.hpp +++ b/src/core/include/ngraph/op/is_inf.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/is_inf.hpp" diff --git a/src/core/include/ngraph/op/is_nan.hpp b/src/core/include/ngraph/op/is_nan.hpp index c977b266c72..61426c448b1 100644 --- a/src/core/include/ngraph/op/is_nan.hpp +++ b/src/core/include/ngraph/op/is_nan.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/is_nan.hpp" diff --git a/src/core/include/ngraph/op/less.hpp b/src/core/include/ngraph/op/less.hpp index cec7030d0ef..9c9772f4533 100644 --- a/src/core/include/ngraph/op/less.hpp +++ b/src/core/include/ngraph/op/less.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/less.hpp" diff --git a/src/core/include/ngraph/op/less_eq.hpp b/src/core/include/ngraph/op/less_eq.hpp index 661db4ac2f7..6e2bd02da34 100644 --- a/src/core/include/ngraph/op/less_eq.hpp +++ b/src/core/include/ngraph/op/less_eq.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/less_eq.hpp" diff --git a/src/core/include/ngraph/op/log.hpp b/src/core/include/ngraph/op/log.hpp index 7277a2299c2..f590366b208 100644 --- a/src/core/include/ngraph/op/log.hpp +++ b/src/core/include/ngraph/op/log.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/log.hpp" diff --git a/src/core/include/ngraph/op/log_softmax.hpp b/src/core/include/ngraph/op/log_softmax.hpp index 9fd3bf2cb37..09a4ab0fecc 100644 --- a/src/core/include/ngraph/op/log_softmax.hpp +++ b/src/core/include/ngraph/op/log_softmax.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/log_softmax.hpp" diff --git a/src/core/include/ngraph/op/loop.hpp b/src/core/include/ngraph/op/loop.hpp index ebf4c55b75a..9c146269658 100644 --- a/src/core/include/ngraph/op/loop.hpp +++ b/src/core/include/ngraph/op/loop.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/factory_adapter.hpp" diff --git a/src/core/include/ngraph/op/lrn.hpp b/src/core/include/ngraph/op/lrn.hpp index 15a6d1806b1..533c3fdd8ac 100644 --- a/src/core/include/ngraph/op/lrn.hpp +++ b/src/core/include/ngraph/op/lrn.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/lrn.hpp" diff --git a/src/core/include/ngraph/op/lstm_cell.hpp b/src/core/include/ngraph/op/lstm_cell.hpp index fad3b89d758..9714e9bb362 100644 --- a/src/core/include/ngraph/op/lstm_cell.hpp +++ b/src/core/include/ngraph/op/lstm_cell.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/lstm_sequence.hpp b/src/core/include/ngraph/op/lstm_sequence.hpp index 6e0221de859..72a2bfd1aec 100644 --- a/src/core/include/ngraph/op/lstm_sequence.hpp +++ b/src/core/include/ngraph/op/lstm_sequence.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/matmul.hpp b/src/core/include/ngraph/op/matmul.hpp index 1b43bcf60d6..e72c43dc0eb 100644 --- a/src/core/include/ngraph/op/matmul.hpp +++ b/src/core/include/ngraph/op/matmul.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/matmul.hpp" diff --git a/src/core/include/ngraph/op/matrix_nms.hpp b/src/core/include/ngraph/op/matrix_nms.hpp index 3a5389ebe7f..eab69f6cb59 100644 --- a/src/core/include/ngraph/op/matrix_nms.hpp +++ b/src/core/include/ngraph/op/matrix_nms.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/matrix_nms.hpp" diff --git a/src/core/include/ngraph/op/max.hpp b/src/core/include/ngraph/op/max.hpp index 52ca2392464..39dc365f118 100644 --- a/src/core/include/ngraph/op/max.hpp +++ b/src/core/include/ngraph/op/max.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/arithmetic_reduction.hpp" #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_max.hpp" diff --git a/src/core/include/ngraph/op/max_pool.hpp b/src/core/include/ngraph/op/max_pool.hpp index 998b91ed7a7..43d9ee25693 100644 --- a/src/core/include/ngraph/op/max_pool.hpp +++ b/src/core/include/ngraph/op/max_pool.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/max_pool_base.hpp" diff --git a/src/core/include/ngraph/op/maximum.hpp b/src/core/include/ngraph/op/maximum.hpp index 65879eed2d0..3f881f3d8c2 100644 --- a/src/core/include/ngraph/op/maximum.hpp +++ b/src/core/include/ngraph/op/maximum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/maximum.hpp" diff --git a/src/core/include/ngraph/op/min.hpp b/src/core/include/ngraph/op/min.hpp index 539d65d58c8..46e813f8ce9 100644 --- a/src/core/include/ngraph/op/min.hpp +++ b/src/core/include/ngraph/op/min.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/arithmetic_reduction.hpp" #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_min.hpp" diff --git a/src/core/include/ngraph/op/minimum.hpp b/src/core/include/ngraph/op/minimum.hpp index 447f5ea07df..4d515d017e1 100644 --- a/src/core/include/ngraph/op/minimum.hpp +++ b/src/core/include/ngraph/op/minimum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/minimum.hpp" diff --git a/src/core/include/ngraph/op/mish.hpp b/src/core/include/ngraph/op/mish.hpp index e9edf3fee63..d310c5370a7 100644 --- a/src/core/include/ngraph/op/mish.hpp +++ b/src/core/include/ngraph/op/mish.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/mish.hpp" diff --git a/src/core/include/ngraph/op/mod.hpp b/src/core/include/ngraph/op/mod.hpp index c6a3beb7f14..92081e8fe8d 100644 --- a/src/core/include/ngraph/op/mod.hpp +++ b/src/core/include/ngraph/op/mod.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/mod.hpp" diff --git a/src/core/include/ngraph/op/multiclass_nms.hpp b/src/core/include/ngraph/op/multiclass_nms.hpp index 624f66b53d1..19ae119a221 100644 --- a/src/core/include/ngraph/op/multiclass_nms.hpp +++ b/src/core/include/ngraph/op/multiclass_nms.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/multiclass_nms_base.hpp" #include "openvino/op/multiclass_nms.hpp" diff --git a/src/core/include/ngraph/op/multiply.hpp b/src/core/include/ngraph/op/multiply.hpp index 1136976b66a..9e935312462 100644 --- a/src/core/include/ngraph/op/multiply.hpp +++ b/src/core/include/ngraph/op/multiply.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/multiply.hpp" diff --git a/src/core/include/ngraph/op/mvn.hpp b/src/core/include/ngraph/op/mvn.hpp index b5f98c375a6..3c7a4f2a486 100644 --- a/src/core/include/ngraph/op/mvn.hpp +++ b/src/core/include/ngraph/op/mvn.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/mvn.hpp" diff --git a/src/core/include/ngraph/op/negative.hpp b/src/core/include/ngraph/op/negative.hpp index 74cd2c999c8..a8720495518 100644 --- a/src/core/include/ngraph/op/negative.hpp +++ b/src/core/include/ngraph/op/negative.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/negative.hpp" diff --git a/src/core/include/ngraph/op/non_max_suppression.hpp b/src/core/include/ngraph/op/non_max_suppression.hpp index e18af6bf206..0797e792fdd 100644 --- a/src/core/include/ngraph/op/non_max_suppression.hpp +++ b/src/core/include/ngraph/op/non_max_suppression.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/non_max_suppression.hpp" diff --git a/src/core/include/ngraph/op/non_zero.hpp b/src/core/include/ngraph/op/non_zero.hpp index 15b47dfdb6b..75a48ba7ebd 100644 --- a/src/core/include/ngraph/op/non_zero.hpp +++ b/src/core/include/ngraph/op/non_zero.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/non_zero.hpp" diff --git a/src/core/include/ngraph/op/normalize_l2.hpp b/src/core/include/ngraph/op/normalize_l2.hpp index dab602e5753..9e9ab00a9a6 100644 --- a/src/core/include/ngraph/op/normalize_l2.hpp +++ b/src/core/include/ngraph/op/normalize_l2.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/op/not.hpp b/src/core/include/ngraph/op/not.hpp index 9ac0e78265e..64f5e492c24 100644 --- a/src/core/include/ngraph/op/not.hpp +++ b/src/core/include/ngraph/op/not.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/logical_not.hpp" diff --git a/src/core/include/ngraph/op/not_equal.hpp b/src/core/include/ngraph/op/not_equal.hpp index 51bdc4c5482..883d48c63a9 100644 --- a/src/core/include/ngraph/op/not_equal.hpp +++ b/src/core/include/ngraph/op/not_equal.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_comparison.hpp" #include "openvino/op/not_equal.hpp" diff --git a/src/core/include/ngraph/op/nv12_to_bgr.hpp b/src/core/include/ngraph/op/nv12_to_bgr.hpp index 6967f7b10d5..0044d2049b0 100644 --- a/src/core/include/ngraph/op/nv12_to_bgr.hpp +++ b/src/core/include/ngraph/op/nv12_to_bgr.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/nv12_to_bgr.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/nv12_to_rgb.hpp b/src/core/include/ngraph/op/nv12_to_rgb.hpp index 2ce1e1e8b10..bd3bdb710ae 100644 --- a/src/core/include/ngraph/op/nv12_to_rgb.hpp +++ b/src/core/include/ngraph/op/nv12_to_rgb.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/nv12_to_rgb.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/one_hot.hpp b/src/core/include/ngraph/op/one_hot.hpp index 5e500f48cc5..52618026eaf 100644 --- a/src/core/include/ngraph/op/one_hot.hpp +++ b/src/core/include/ngraph/op/one_hot.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/one_hot.hpp" diff --git a/src/core/include/ngraph/op/op.hpp b/src/core/include/ngraph/op/op.hpp index ccb5d44c147..0fe6936ebf2 100644 --- a/src/core/include/ngraph/op/op.hpp +++ b/src/core/include/ngraph/op/op.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/op/or.hpp b/src/core/include/ngraph/op/or.hpp index 09e803de5c7..cefc9f23e59 100644 --- a/src/core/include/ngraph/op/or.hpp +++ b/src/core/include/ngraph/op/or.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/binary_elementwise_logical.hpp" diff --git a/src/core/include/ngraph/op/pad.hpp b/src/core/include/ngraph/op/pad.hpp index 8a20178ae90..6176c09d236 100644 --- a/src/core/include/ngraph/op/pad.hpp +++ b/src/core/include/ngraph/op/pad.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/parameter.hpp b/src/core/include/ngraph/op/parameter.hpp index b918851b618..50b432f9662 100644 --- a/src/core/include/ngraph/op/parameter.hpp +++ b/src/core/include/ngraph/op/parameter.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/parameter.hpp" diff --git a/src/core/include/ngraph/op/power.hpp b/src/core/include/ngraph/op/power.hpp index 4053f05bc19..75bd9457687 100644 --- a/src/core/include/ngraph/op/power.hpp +++ b/src/core/include/ngraph/op/power.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/power.hpp" diff --git a/src/core/include/ngraph/op/prelu.hpp b/src/core/include/ngraph/op/prelu.hpp index 6a74c0d1151..a88fec42c7b 100644 --- a/src/core/include/ngraph/op/prelu.hpp +++ b/src/core/include/ngraph/op/prelu.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/prelu.hpp" diff --git a/src/core/include/ngraph/op/prior_box.hpp b/src/core/include/ngraph/op/prior_box.hpp index 7a1ece4f743..e8ed48bbe74 100644 --- a/src/core/include/ngraph/op/prior_box.hpp +++ b/src/core/include/ngraph/op/prior_box.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/prior_box.hpp" diff --git a/src/core/include/ngraph/op/prior_box_clustered.hpp b/src/core/include/ngraph/op/prior_box_clustered.hpp index 8cdd98d466a..17dceb8b453 100644 --- a/src/core/include/ngraph/op/prior_box_clustered.hpp +++ b/src/core/include/ngraph/op/prior_box_clustered.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/prior_box_clustered.hpp" diff --git a/src/core/include/ngraph/op/proposal.hpp b/src/core/include/ngraph/op/proposal.hpp index 75fe40ba7da..65c5481fa12 100644 --- a/src/core/include/ngraph/op/proposal.hpp +++ b/src/core/include/ngraph/op/proposal.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/proposal.hpp" diff --git a/src/core/include/ngraph/op/psroi_pooling.hpp b/src/core/include/ngraph/op/psroi_pooling.hpp index 1aee23b6068..a7d4e11f044 100644 --- a/src/core/include/ngraph/op/psroi_pooling.hpp +++ b/src/core/include/ngraph/op/psroi_pooling.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/psroi_pooling.hpp" diff --git a/src/core/include/ngraph/op/random_uniform.hpp b/src/core/include/ngraph/op/random_uniform.hpp index fee42059cbe..1c55a2a3b82 100644 --- a/src/core/include/ngraph/op/random_uniform.hpp +++ b/src/core/include/ngraph/op/random_uniform.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/random_uniform.hpp" diff --git a/src/core/include/ngraph/op/range.hpp b/src/core/include/ngraph/op/range.hpp index 392fe31ce07..274a8ca5bbc 100644 --- a/src/core/include/ngraph/op/range.hpp +++ b/src/core/include/ngraph/op/range.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/range.hpp" diff --git a/src/core/include/ngraph/op/rdft.hpp b/src/core/include/ngraph/op/rdft.hpp index efefda5ac57..3f4cc966415 100644 --- a/src/core/include/ngraph/op/rdft.hpp +++ b/src/core/include/ngraph/op/rdft.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/rdft.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/read_value.hpp b/src/core/include/ngraph/op/read_value.hpp index 265aeca05f3..82eefe8e663 100644 --- a/src/core/include/ngraph/op/read_value.hpp +++ b/src/core/include/ngraph/op/read_value.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/variable.hpp" #include "ngraph/op/util/variable_extension.hpp" diff --git a/src/core/include/ngraph/op/reduce_l1.hpp b/src/core/include/ngraph/op/reduce_l1.hpp index 16970be740e..da3964cef74 100644 --- a/src/core/include/ngraph/op/reduce_l1.hpp +++ b/src/core/include/ngraph/op/reduce_l1.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_l1.hpp" diff --git a/src/core/include/ngraph/op/reduce_l2.hpp b/src/core/include/ngraph/op/reduce_l2.hpp index d2ee38a6b93..0a4667c03ab 100644 --- a/src/core/include/ngraph/op/reduce_l2.hpp +++ b/src/core/include/ngraph/op/reduce_l2.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_l2.hpp" diff --git a/src/core/include/ngraph/op/reduce_logical_and.hpp b/src/core/include/ngraph/op/reduce_logical_and.hpp index ca29a7fa6e8..cb6e06f8e42 100644 --- a/src/core/include/ngraph/op/reduce_logical_and.hpp +++ b/src/core/include/ngraph/op/reduce_logical_and.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/logical_reduction_keep_dims.hpp" #include "openvino/op/reduce_logical_and.hpp" diff --git a/src/core/include/ngraph/op/reduce_logical_or.hpp b/src/core/include/ngraph/op/reduce_logical_or.hpp index 93cc267acd9..e2a1b8782a0 100644 --- a/src/core/include/ngraph/op/reduce_logical_or.hpp +++ b/src/core/include/ngraph/op/reduce_logical_or.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/logical_reduction_keep_dims.hpp" #include "openvino/op/reduce_logical_or.hpp" diff --git a/src/core/include/ngraph/op/reduce_mean.hpp b/src/core/include/ngraph/op/reduce_mean.hpp index a7f098332cd..4092f908367 100644 --- a/src/core/include/ngraph/op/reduce_mean.hpp +++ b/src/core/include/ngraph/op/reduce_mean.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_mean.hpp" diff --git a/src/core/include/ngraph/op/reduce_prod.hpp b/src/core/include/ngraph/op/reduce_prod.hpp index a2b321fb4b1..4f657399f3e 100644 --- a/src/core/include/ngraph/op/reduce_prod.hpp +++ b/src/core/include/ngraph/op/reduce_prod.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_prod.hpp" diff --git a/src/core/include/ngraph/op/reduce_sum.hpp b/src/core/include/ngraph/op/reduce_sum.hpp index 278074b5313..b2022c59d0f 100644 --- a/src/core/include/ngraph/op/reduce_sum.hpp +++ b/src/core/include/ngraph/op/reduce_sum.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/arithmetic_reductions_keep_dims.hpp" #include "openvino/op/reduce_sum.hpp" diff --git a/src/core/include/ngraph/op/region_yolo.hpp b/src/core/include/ngraph/op/region_yolo.hpp index 835c28ee0cd..ea93351b037 100644 --- a/src/core/include/ngraph/op/region_yolo.hpp +++ b/src/core/include/ngraph/op/region_yolo.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/region_yolo.hpp" diff --git a/src/core/include/ngraph/op/relu.hpp b/src/core/include/ngraph/op/relu.hpp index ff42f213f00..237bdc113c1 100644 --- a/src/core/include/ngraph/op/relu.hpp +++ b/src/core/include/ngraph/op/relu.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/op/reorg_yolo.hpp b/src/core/include/ngraph/op/reorg_yolo.hpp index d50ba686078..1359e97a518 100644 --- a/src/core/include/ngraph/op/reorg_yolo.hpp +++ b/src/core/include/ngraph/op/reorg_yolo.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/reorg_yolo.hpp" diff --git a/src/core/include/ngraph/op/reshape.hpp b/src/core/include/ngraph/op/reshape.hpp index b60ae494656..8220d2f9566 100644 --- a/src/core/include/ngraph/op/reshape.hpp +++ b/src/core/include/ngraph/op/reshape.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_vector.hpp" #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/result.hpp b/src/core/include/ngraph/op/result.hpp index d5b25592aad..a3429b0b696 100644 --- a/src/core/include/ngraph/op/result.hpp +++ b/src/core/include/ngraph/op/result.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/reverse.hpp b/src/core/include/ngraph/op/reverse.hpp index 5129ad274df..f7b5569812e 100644 --- a/src/core/include/ngraph/op/reverse.hpp +++ b/src/core/include/ngraph/op/reverse.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/reverse.hpp" diff --git a/src/core/include/ngraph/op/reverse_sequence.hpp b/src/core/include/ngraph/op/reverse_sequence.hpp index bc7ebf53e03..4ce7389f7b2 100644 --- a/src/core/include/ngraph/op/reverse_sequence.hpp +++ b/src/core/include/ngraph/op/reverse_sequence.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/reverse_sequence.hpp" diff --git a/src/core/include/ngraph/op/rnn_cell.hpp b/src/core/include/ngraph/op/rnn_cell.hpp index 6f4bbc15718..5111833cd82 100644 --- a/src/core/include/ngraph/op/rnn_cell.hpp +++ b/src/core/include/ngraph/op/rnn_cell.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/rnn_sequence.hpp b/src/core/include/ngraph/op/rnn_sequence.hpp index 5712c1053c3..08397b75215 100644 --- a/src/core/include/ngraph/op/rnn_sequence.hpp +++ b/src/core/include/ngraph/op/rnn_sequence.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/roi_align.hpp b/src/core/include/ngraph/op/roi_align.hpp index 986717a4dbc..e8b645a827d 100644 --- a/src/core/include/ngraph/op/roi_align.hpp +++ b/src/core/include/ngraph/op/roi_align.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/roi_align.hpp" diff --git a/src/core/include/ngraph/op/roi_pooling.hpp b/src/core/include/ngraph/op/roi_pooling.hpp index 46812514ba7..b6d2ee15f40 100644 --- a/src/core/include/ngraph/op/roi_pooling.hpp +++ b/src/core/include/ngraph/op/roi_pooling.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/roi_pooling.hpp" diff --git a/src/core/include/ngraph/op/roll.hpp b/src/core/include/ngraph/op/roll.hpp index 4d5005c3cc3..2f3939bb9a4 100644 --- a/src/core/include/ngraph/op/roll.hpp +++ b/src/core/include/ngraph/op/roll.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/roll.hpp" diff --git a/src/core/include/ngraph/op/round.hpp b/src/core/include/ngraph/op/round.hpp index a428201766d..ee3e492b5a6 100644 --- a/src/core/include/ngraph/op/round.hpp +++ b/src/core/include/ngraph/op/round.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/scatter_elements_update.hpp b/src/core/include/ngraph/op/scatter_elements_update.hpp index 0e367a732c1..056fcf64f38 100644 --- a/src/core/include/ngraph/op/scatter_elements_update.hpp +++ b/src/core/include/ngraph/op/scatter_elements_update.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_vector.hpp" #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/scatter_nd_update.hpp b/src/core/include/ngraph/op/scatter_nd_update.hpp index e70e34322a9..844f2b4744b 100644 --- a/src/core/include/ngraph/op/scatter_nd_update.hpp +++ b/src/core/include/ngraph/op/scatter_nd_update.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/scatter_nd_base.hpp" #include "openvino/op/scatter_nd_update.hpp" diff --git a/src/core/include/ngraph/op/scatter_update.hpp b/src/core/include/ngraph/op/scatter_update.hpp index 5b83952fe4d..8d00f786a65 100644 --- a/src/core/include/ngraph/op/scatter_update.hpp +++ b/src/core/include/ngraph/op/scatter_update.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/scatter_base.hpp" #include "ngraph/runtime/host_tensor.hpp" diff --git a/src/core/include/ngraph/op/select.hpp b/src/core/include/ngraph/op/select.hpp index 86606974ebd..b3f06e3d899 100644 --- a/src/core/include/ngraph/op/select.hpp +++ b/src/core/include/ngraph/op/select.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/select.hpp" diff --git a/src/core/include/ngraph/op/selu.hpp b/src/core/include/ngraph/op/selu.hpp index 1355cf54c7a..26e61c6eb74 100644 --- a/src/core/include/ngraph/op/selu.hpp +++ b/src/core/include/ngraph/op/selu.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/selu.hpp" diff --git a/src/core/include/ngraph/op/shape_of.hpp b/src/core/include/ngraph/op/shape_of.hpp index 46d549936be..79968883133 100644 --- a/src/core/include/ngraph/op/shape_of.hpp +++ b/src/core/include/ngraph/op/shape_of.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/shape_of.hpp" diff --git a/src/core/include/ngraph/op/shuffle_channels.hpp b/src/core/include/ngraph/op/shuffle_channels.hpp index 29426ed4b49..adc901855e7 100644 --- a/src/core/include/ngraph/op/shuffle_channels.hpp +++ b/src/core/include/ngraph/op/shuffle_channels.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/op/sigmoid.hpp b/src/core/include/ngraph/op/sigmoid.hpp index d093c7100fc..89a2e4a25a0 100644 --- a/src/core/include/ngraph/op/sigmoid.hpp +++ b/src/core/include/ngraph/op/sigmoid.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/sign.hpp b/src/core/include/ngraph/op/sign.hpp index 810c949b3dc..5cc50db67fe 100644 --- a/src/core/include/ngraph/op/sign.hpp +++ b/src/core/include/ngraph/op/sign.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/sign.hpp" diff --git a/src/core/include/ngraph/op/sin.hpp b/src/core/include/ngraph/op/sin.hpp index 969b7acd4fa..45ae7dfd448 100644 --- a/src/core/include/ngraph/op/sin.hpp +++ b/src/core/include/ngraph/op/sin.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/sin.hpp" diff --git a/src/core/include/ngraph/op/sinh.hpp b/src/core/include/ngraph/op/sinh.hpp index 4390fabd333..f6b8c99332e 100644 --- a/src/core/include/ngraph/op/sinh.hpp +++ b/src/core/include/ngraph/op/sinh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/sinh.hpp" diff --git a/src/core/include/ngraph/op/sink.hpp b/src/core/include/ngraph/op/sink.hpp index c7bc3a087d8..f5fd2e57af6 100644 --- a/src/core/include/ngraph/op/sink.hpp +++ b/src/core/include/ngraph/op/sink.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/slice.hpp b/src/core/include/ngraph/op/slice.hpp index fe63c28c769..f9dc771b2bc 100644 --- a/src/core/include/ngraph/op/slice.hpp +++ b/src/core/include/ngraph/op/slice.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/slice.hpp" diff --git a/src/core/include/ngraph/op/softmax.hpp b/src/core/include/ngraph/op/softmax.hpp index 9555ac8ba87..af1b7d617b4 100644 --- a/src/core/include/ngraph/op/softmax.hpp +++ b/src/core/include/ngraph/op/softmax.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/softmax.hpp" diff --git a/src/core/include/ngraph/op/softplus.hpp b/src/core/include/ngraph/op/softplus.hpp index 9da59d42e78..3bed43efa1a 100644 --- a/src/core/include/ngraph/op/softplus.hpp +++ b/src/core/include/ngraph/op/softplus.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/softplus.hpp" diff --git a/src/core/include/ngraph/op/softsign.hpp b/src/core/include/ngraph/op/softsign.hpp index a45dec50a0c..289e258d3e2 100644 --- a/src/core/include/ngraph/op/softsign.hpp +++ b/src/core/include/ngraph/op/softsign.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/op/softsign.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/space_to_batch.hpp b/src/core/include/ngraph/op/space_to_batch.hpp index a38d54eab34..b1d433f0d5e 100644 --- a/src/core/include/ngraph/op/space_to_batch.hpp +++ b/src/core/include/ngraph/op/space_to_batch.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/space_to_batch.hpp" diff --git a/src/core/include/ngraph/op/space_to_depth.hpp b/src/core/include/ngraph/op/space_to_depth.hpp index d11b64b9c19..d6e0eb4024a 100644 --- a/src/core/include/ngraph/op/space_to_depth.hpp +++ b/src/core/include/ngraph/op/space_to_depth.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/space_to_depth.hpp" diff --git a/src/core/include/ngraph/op/split.hpp b/src/core/include/ngraph/op/split.hpp index 171ebe30f18..00d0b80a822 100644 --- a/src/core/include/ngraph/op/split.hpp +++ b/src/core/include/ngraph/op/split.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/sqrt.hpp b/src/core/include/ngraph/op/sqrt.hpp index 64540e0b25c..9db2668b2d8 100644 --- a/src/core/include/ngraph/op/sqrt.hpp +++ b/src/core/include/ngraph/op/sqrt.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/sqrt.hpp" diff --git a/src/core/include/ngraph/op/squared_difference.hpp b/src/core/include/ngraph/op/squared_difference.hpp index 338cf8cdfe3..44ebfb23b1f 100644 --- a/src/core/include/ngraph/op/squared_difference.hpp +++ b/src/core/include/ngraph/op/squared_difference.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/squared_difference.hpp" diff --git a/src/core/include/ngraph/op/squeeze.hpp b/src/core/include/ngraph/op/squeeze.hpp index 662ba8a5159..194ae1b9b60 100644 --- a/src/core/include/ngraph/op/squeeze.hpp +++ b/src/core/include/ngraph/op/squeeze.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/axis_vector.hpp" diff --git a/src/core/include/ngraph/op/strided_slice.hpp b/src/core/include/ngraph/op/strided_slice.hpp index 3ceec33f8fc..1e604ca8b9c 100644 --- a/src/core/include/ngraph/op/strided_slice.hpp +++ b/src/core/include/ngraph/op/strided_slice.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/subtract.hpp b/src/core/include/ngraph/op/subtract.hpp index 4637c4ee5eb..6bc02261c18 100644 --- a/src/core/include/ngraph/op/subtract.hpp +++ b/src/core/include/ngraph/op/subtract.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/subtract.hpp" diff --git a/src/core/include/ngraph/op/swish.hpp b/src/core/include/ngraph/op/swish.hpp index 28132386159..d001693e8e2 100644 --- a/src/core/include/ngraph/op/swish.hpp +++ b/src/core/include/ngraph/op/swish.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "openvino/op/swish.hpp" diff --git a/src/core/include/ngraph/op/tan.hpp b/src/core/include/ngraph/op/tan.hpp index 9bedeba98a1..86fe0ba4a80 100644 --- a/src/core/include/ngraph/op/tan.hpp +++ b/src/core/include/ngraph/op/tan.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/tan.hpp" diff --git a/src/core/include/ngraph/op/tanh.hpp b/src/core/include/ngraph/op/tanh.hpp index 329587f52c9..4b22ea39cba 100644 --- a/src/core/include/ngraph/op/tanh.hpp +++ b/src/core/include/ngraph/op/tanh.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" #include "openvino/op/tanh.hpp" diff --git a/src/core/include/ngraph/op/tensor_iterator.hpp b/src/core/include/ngraph/op/tensor_iterator.hpp index 4fad924a9ea..e2a2e8dcd51 100644 --- a/src/core/include/ngraph/op/tensor_iterator.hpp +++ b/src/core/include/ngraph/op/tensor_iterator.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/function.hpp" diff --git a/src/core/include/ngraph/op/tile.hpp b/src/core/include/ngraph/op/tile.hpp index 5110389d704..ba99b63f440 100644 --- a/src/core/include/ngraph/op/tile.hpp +++ b/src/core/include/ngraph/op/tile.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "openvino/op/tile.hpp" diff --git a/src/core/include/ngraph/op/topk.hpp b/src/core/include/ngraph/op/topk.hpp index 18c20013ef4..c10368fe277 100644 --- a/src/core/include/ngraph/op/topk.hpp +++ b/src/core/include/ngraph/op/topk.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/axis_set.hpp" diff --git a/src/core/include/ngraph/op/transpose.hpp b/src/core/include/ngraph/op/transpose.hpp index 447a2853506..a042ae4eaef 100644 --- a/src/core/include/ngraph/op/transpose.hpp +++ b/src/core/include/ngraph/op/transpose.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_vector.hpp" #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/unique.hpp b/src/core/include/ngraph/op/unique.hpp index 551624f3378..c1439fbf420 100644 --- a/src/core/include/ngraph/op/unique.hpp +++ b/src/core/include/ngraph/op/unique.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/unique.hpp" diff --git a/src/core/include/ngraph/op/unsqueeze.hpp b/src/core/include/ngraph/op/unsqueeze.hpp index 340a72958b6..2f278db8f53 100644 --- a/src/core/include/ngraph/op/unsqueeze.hpp +++ b/src/core/include/ngraph/op/unsqueeze.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/axis_vector.hpp" diff --git a/src/core/include/ngraph/op/util/activation_functions.hpp b/src/core/include/ngraph/op/util/activation_functions.hpp index 942801add76..0d10003aac5 100644 --- a/src/core/include/ngraph/op/util/activation_functions.hpp +++ b/src/core/include/ngraph/op/util/activation_functions.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/util/arithmetic_reduction.hpp b/src/core/include/ngraph/op/util/arithmetic_reduction.hpp index 912857a8786..03ab9058491 100644 --- a/src/core/include/ngraph/op/util/arithmetic_reduction.hpp +++ b/src/core/include/ngraph/op/util/arithmetic_reduction.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/reduction_base.hpp" #include "openvino/op/util/arithmetic_reduction.hpp" diff --git a/src/core/include/ngraph/op/util/arithmetic_reductions_keep_dims.hpp b/src/core/include/ngraph/op/util/arithmetic_reductions_keep_dims.hpp index fcb5fe13d90..829bcf5d085 100644 --- a/src/core/include/ngraph/op/util/arithmetic_reductions_keep_dims.hpp +++ b/src/core/include/ngraph/op/util/arithmetic_reductions_keep_dims.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/arithmetic_reduction.hpp" #include "openvino/op/util/arithmetic_reductions_keep_dims.hpp" diff --git a/src/core/include/ngraph/op/util/attr_types.hpp b/src/core/include/ngraph/op/util/attr_types.hpp index f415ab1ed78..1d18f416695 100644 --- a/src/core/include/ngraph/op/util/attr_types.hpp +++ b/src/core/include/ngraph/op/util/attr_types.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/util/binary_elementwise_arithmetic.hpp b/src/core/include/ngraph/op/util/binary_elementwise_arithmetic.hpp index 08921c25669..2e8acdc7462 100644 --- a/src/core/include/ngraph/op/util/binary_elementwise_arithmetic.hpp +++ b/src/core/include/ngraph/op/util/binary_elementwise_arithmetic.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/util/binary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/util/binary_elementwise_comparison.hpp b/src/core/include/ngraph/op/util/binary_elementwise_comparison.hpp index 01f49bac69d..6f507e40da6 100644 --- a/src/core/include/ngraph/op/util/binary_elementwise_comparison.hpp +++ b/src/core/include/ngraph/op/util/binary_elementwise_comparison.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/util/binary_elementwise_comparison.hpp" diff --git a/src/core/include/ngraph/op/util/binary_elementwise_logical.hpp b/src/core/include/ngraph/op/util/binary_elementwise_logical.hpp index 34f7d4d522d..46e733b149b 100644 --- a/src/core/include/ngraph/op/util/binary_elementwise_logical.hpp +++ b/src/core/include/ngraph/op/util/binary_elementwise_logical.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/binary_elementwise_logical.hpp" diff --git a/src/core/include/ngraph/op/util/broadcast_base.hpp b/src/core/include/ngraph/op/util/broadcast_base.hpp index 5e33c2cb4b5..297de17107c 100644 --- a/src/core/include/ngraph/op/util/broadcast_base.hpp +++ b/src/core/include/ngraph/op/util/broadcast_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/axis_vector.hpp" #include "ngraph/op/op.hpp" diff --git a/src/core/include/ngraph/op/util/deformable_convolution_base.hpp b/src/core/include/ngraph/op/util/deformable_convolution_base.hpp index 68c2043d413..c670f9e7fc0 100644 --- a/src/core/include/ngraph/op/util/deformable_convolution_base.hpp +++ b/src/core/include/ngraph/op/util/deformable_convolution_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/util/detection_output_base.hpp b/src/core/include/ngraph/op/util/detection_output_base.hpp index e37f5350dba..806ba06a0b7 100644 --- a/src/core/include/ngraph/op/util/detection_output_base.hpp +++ b/src/core/include/ngraph/op/util/detection_output_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/detection_output_base.hpp" diff --git a/src/core/include/ngraph/op/util/elementwise_args.hpp b/src/core/include/ngraph/op/util/elementwise_args.hpp index 55ca18dca3b..6049761ef11 100644 --- a/src/core/include/ngraph/op/util/elementwise_args.hpp +++ b/src/core/include/ngraph/op/util/elementwise_args.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "openvino/op/util/elementwise_args.hpp" diff --git a/src/core/include/ngraph/op/util/embeddingbag_offsets_base.hpp b/src/core/include/ngraph/op/util/embeddingbag_offsets_base.hpp index 0da4ff6aec4..943737251e1 100644 --- a/src/core/include/ngraph/op/util/embeddingbag_offsets_base.hpp +++ b/src/core/include/ngraph/op/util/embeddingbag_offsets_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/index_reduction.hpp" #include "openvino/op/util/embeddingbag_offsets_base.hpp" diff --git a/src/core/include/ngraph/op/util/embeddingbag_packed_base.hpp b/src/core/include/ngraph/op/util/embeddingbag_packed_base.hpp index 484a99164b4..a66c0b52315 100644 --- a/src/core/include/ngraph/op/util/embeddingbag_packed_base.hpp +++ b/src/core/include/ngraph/op/util/embeddingbag_packed_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/op/util/index_reduction.hpp" #include "openvino/op/util/embeddingbag_packed_base.hpp" diff --git a/src/core/include/ngraph/op/util/evaluate_helpers.hpp b/src/core/include/ngraph/op/util/evaluate_helpers.hpp index 3d2de845bc8..02e6730b5fc 100644 --- a/src/core/include/ngraph/op/util/evaluate_helpers.hpp +++ b/src/core/include/ngraph/op/util/evaluate_helpers.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/axis_set.hpp" #include "ngraph/descriptor/tensor.hpp" #include "ngraph/util.hpp" @@ -17,7 +27,7 @@ namespace ngraph { /// \param node_description An identifier of the operator's node (used to report errors) /// /// \return Normalized (positive only) axes as an AxisSet object. -AxisSet get_normalized_axes_from_tensor(const HostTensorPtr tensor, - const ngraph::Rank& rank, - const std::string& node_description); +NGRAPH_API_DEPRECATED AxisSet get_normalized_axes_from_tensor(const HostTensorPtr tensor, + const ngraph::Rank& rank, + const std::string& node_description); } // namespace ngraph diff --git a/src/core/include/ngraph/op/util/fft_base.hpp b/src/core/include/ngraph/op/util/fft_base.hpp index 5b829ba0945..d30134d1a53 100644 --- a/src/core/include/ngraph/op/util/fft_base.hpp +++ b/src/core/include/ngraph/op/util/fft_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/util/fft_base.hpp" diff --git a/src/core/include/ngraph/op/util/framework_node.hpp b/src/core/include/ngraph/op/util/framework_node.hpp index df1c65e2457..f65b23451b8 100644 --- a/src/core/include/ngraph/op/util/framework_node.hpp +++ b/src/core/include/ngraph/op/util/framework_node.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/framework_node.hpp" diff --git a/src/core/include/ngraph/op/util/gather_base.hpp b/src/core/include/ngraph/op/util/gather_base.hpp index 3afeffa719e..d098fdc272b 100644 --- a/src/core/include/ngraph/op/util/gather_base.hpp +++ b/src/core/include/ngraph/op/util/gather_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/gather_base.hpp" diff --git a/src/core/include/ngraph/op/util/gather_nd_base.hpp b/src/core/include/ngraph/op/util/gather_nd_base.hpp index e943f51683e..be066f26528 100644 --- a/src/core/include/ngraph/op/util/gather_nd_base.hpp +++ b/src/core/include/ngraph/op/util/gather_nd_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/gather_nd_base.hpp" diff --git a/src/core/include/ngraph/op/util/index_reduction.hpp b/src/core/include/ngraph/op/util/index_reduction.hpp index 4b52ef6951f..1b934cce3f2 100644 --- a/src/core/include/ngraph/op/util/index_reduction.hpp +++ b/src/core/include/ngraph/op/util/index_reduction.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/util/logical_reduction.hpp b/src/core/include/ngraph/op/util/logical_reduction.hpp index 71fa5433cd1..d20cf28a8b3 100644 --- a/src/core/include/ngraph/op/util/logical_reduction.hpp +++ b/src/core/include/ngraph/op/util/logical_reduction.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/reduction_base.hpp" #include "openvino/op/util/logical_reduction.hpp" diff --git a/src/core/include/ngraph/op/util/logical_reduction_keep_dims.hpp b/src/core/include/ngraph/op/util/logical_reduction_keep_dims.hpp index b9517a696bc..12f440bd3e9 100644 --- a/src/core/include/ngraph/op/util/logical_reduction_keep_dims.hpp +++ b/src/core/include/ngraph/op/util/logical_reduction_keep_dims.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/logical_reduction.hpp" #include "openvino/op/util/logical_reduction_keep_dims.hpp" diff --git a/src/core/include/ngraph/op/util/max_pool_base.hpp b/src/core/include/ngraph/op/util/max_pool_base.hpp index d5db60a7d71..72564c888a9 100644 --- a/src/core/include/ngraph/op/util/max_pool_base.hpp +++ b/src/core/include/ngraph/op/util/max_pool_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "openvino/op/util/max_pool_base.hpp" diff --git a/src/core/include/ngraph/op/util/multi_subgraph_base.hpp b/src/core/include/ngraph/op/util/multi_subgraph_base.hpp index d4c0b86ee62..069dfeea568 100644 --- a/src/core/include/ngraph/op/util/multi_subgraph_base.hpp +++ b/src/core/include/ngraph/op/util/multi_subgraph_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/util/multiclass_nms_base.hpp b/src/core/include/ngraph/op/util/multiclass_nms_base.hpp index ca7b7b8f268..e599f5e0cb0 100644 --- a/src/core/include/ngraph/op/util/multiclass_nms_base.hpp +++ b/src/core/include/ngraph/op/util/multiclass_nms_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/coordinate_diff.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/op/util/op_annotations.hpp b/src/core/include/ngraph/op/util/op_annotations.hpp index 8ef3d67c198..dad2aa3b434 100644 --- a/src/core/include/ngraph/op/util/op_annotations.hpp +++ b/src/core/include/ngraph/op/util/op_annotations.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/deprecated.hpp" @@ -13,7 +23,7 @@ namespace ngraph { namespace op { namespace util { -struct NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon") oi_pair { +struct NGRAPH_API_DEPRECATED oi_pair { size_t output; size_t input; bool destructive; @@ -21,7 +31,7 @@ struct NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon") oi /// \brief Base class for annotations added to graph ops -class NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon") NGRAPH_API OpAnnotations { +class NGRAPH_API_DEPRECATED NGRAPH_API OpAnnotations { NGRAPH_SUPPRESS_DEPRECATED_START public: virtual ~OpAnnotations() = default; diff --git a/src/core/include/ngraph/op/util/op_types.hpp b/src/core/include/ngraph/op/util/op_types.hpp index 13a40b57ace..61a9e2bfe37 100644 --- a/src/core/include/ngraph/op/util/op_types.hpp +++ b/src/core/include/ngraph/op/util/op_types.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/ngraph_visibility.hpp" diff --git a/src/core/include/ngraph/op/util/recurrent_sequence.hpp b/src/core/include/ngraph/op/util/recurrent_sequence.hpp index 3db6f55c2f2..1cf9cc95ea8 100644 --- a/src/core/include/ngraph/op/util/recurrent_sequence.hpp +++ b/src/core/include/ngraph/op/util/recurrent_sequence.hpp @@ -4,8 +4,19 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include +#include "ngraph/deprecated.hpp" #include "ngraph/node.hpp" namespace ngraph { @@ -20,7 +31,7 @@ namespace util { /// \param[in] input Vector with RNNSequence-like op inputs in following order: /// X, initial_hidden_state, sequence_lengths, W, R and B. /// -void validate_seq_input_rank_dimension(const std::vector& input); +NGRAPH_API_DEPRECATED void validate_seq_input_rank_dimension(const std::vector& input); } // namespace util } // namespace op } // namespace ngraph diff --git a/src/core/include/ngraph/op/util/reduction_base.hpp b/src/core/include/ngraph/op/util/reduction_base.hpp index cbed2a71958..94d653781fc 100644 --- a/src/core/include/ngraph/op/util/reduction_base.hpp +++ b/src/core/include/ngraph/op/util/reduction_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/reduction_base.hpp" diff --git a/src/core/include/ngraph/op/util/rnn_cell_base.hpp b/src/core/include/ngraph/op/util/rnn_cell_base.hpp index 0222c4cab46..1c865cb4eb0 100644 --- a/src/core/include/ngraph/op/util/rnn_cell_base.hpp +++ b/src/core/include/ngraph/op/util/rnn_cell_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/op/util/scatter_base.hpp b/src/core/include/ngraph/op/util/scatter_base.hpp index 00cac90e189..73c457b60ba 100644 --- a/src/core/include/ngraph/op/util/scatter_base.hpp +++ b/src/core/include/ngraph/op/util/scatter_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/scatter_base.hpp" diff --git a/src/core/include/ngraph/op/util/scatter_nd_base.hpp b/src/core/include/ngraph/op/util/scatter_nd_base.hpp index 3acc452cefe..9a92acb0091 100644 --- a/src/core/include/ngraph/op/util/scatter_nd_base.hpp +++ b/src/core/include/ngraph/op/util/scatter_nd_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/scatter_nd_base.hpp" diff --git a/src/core/include/ngraph/op/util/slice_plan.hpp b/src/core/include/ngraph/op/util/slice_plan.hpp index b9e31c50444..a0f99cccaed 100644 --- a/src/core/include/ngraph/op/util/slice_plan.hpp +++ b/src/core/include/ngraph/op/util/slice_plan.hpp @@ -4,11 +4,22 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/axis_set.hpp" #include "ngraph/shape.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { // // In various places, like ConstantFolding, it is @@ -27,7 +38,7 @@ namespace ngraph { // // A SlicePlan is used to collect parameters for these ops. // -struct NGRAPH_API SlicePlan { +struct NGRAPH_API_DEPRECATED NGRAPH_API SlicePlan { // Parameters for the Slice std::vector begins; std::vector ends; @@ -44,15 +55,16 @@ struct NGRAPH_API SlicePlan { bool operator!=(const SlicePlan& other) const; }; -SlicePlan NGRAPH_API make_slice_plan(const Shape& input_shape, - const std::vector& begins, - const std::vector& ends, - const std::vector& strides, - const AxisSet& lower_bounds_mask, - const AxisSet& upper_bounds_mask, - const AxisSet& new_axis_mask, - const AxisSet& shrink_axis_mask, - const AxisSet& ellipsis_mask); +NGRAPH_API_DEPRECATED SlicePlan NGRAPH_API make_slice_plan(const Shape& input_shape, + const std::vector& begins, + const std::vector& ends, + const std::vector& strides, + const AxisSet& lower_bounds_mask, + const AxisSet& upper_bounds_mask, + const AxisSet& new_axis_mask, + const AxisSet& shrink_axis_mask, + const AxisSet& ellipsis_mask); } // namespace ngraph using ngraph::make_slice_plan; +NGRAPH_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/op/util/sub_graph_base.hpp b/src/core/include/ngraph/op/util/sub_graph_base.hpp index cc078af251c..48a3098e16d 100644 --- a/src/core/include/ngraph/op/util/sub_graph_base.hpp +++ b/src/core/include/ngraph/op/util/sub_graph_base.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/multi_subgraph_base.hpp" diff --git a/src/core/include/ngraph/op/util/unary_elementwise_arithmetic.hpp b/src/core/include/ngraph/op/util/unary_elementwise_arithmetic.hpp index 4ef30ed0d27..152467da57f 100644 --- a/src/core/include/ngraph/op/util/unary_elementwise_arithmetic.hpp +++ b/src/core/include/ngraph/op/util/unary_elementwise_arithmetic.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/util/unary_elementwise_arithmetic.hpp" diff --git a/src/core/include/ngraph/op/util/variable.hpp b/src/core/include/ngraph/op/util/variable.hpp index 3ac1196ea4f..6bebe43b5fe 100644 --- a/src/core/include/ngraph/op/util/variable.hpp +++ b/src/core/include/ngraph/op/util/variable.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/util/variable_context.hpp b/src/core/include/ngraph/op/util/variable_context.hpp index 1e80bb1f17d..680f871f0c9 100644 --- a/src/core/include/ngraph/op/util/variable_context.hpp +++ b/src/core/include/ngraph/op/util/variable_context.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/op/util/variable_extension.hpp b/src/core/include/ngraph/op/util/variable_extension.hpp index 6357bbbca6b..c93e2c7b717 100644 --- a/src/core/include/ngraph/op/util/variable_extension.hpp +++ b/src/core/include/ngraph/op/util/variable_extension.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/runtime/host_tensor.hpp" diff --git a/src/core/include/ngraph/op/util/variable_value.hpp b/src/core/include/ngraph/op/util/variable_value.hpp index b40d27a1917..c2b657767bc 100644 --- a/src/core/include/ngraph/op/util/variable_value.hpp +++ b/src/core/include/ngraph/op/util/variable_value.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/runtime/host_tensor.hpp" diff --git a/src/core/include/ngraph/op/variadic_split.hpp b/src/core/include/ngraph/op/variadic_split.hpp index fd41a579e78..aea880731dc 100644 --- a/src/core/include/ngraph/op/variadic_split.hpp +++ b/src/core/include/ngraph/op/variadic_split.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/op.hpp" #include "openvino/op/variadic_split.hpp" diff --git a/src/core/include/ngraph/op/xor.hpp b/src/core/include/ngraph/op/xor.hpp index 8b5bb104bd6..e25e59d061c 100644 --- a/src/core/include/ngraph/op/xor.hpp +++ b/src/core/include/ngraph/op/xor.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/binary_elementwise_logical.hpp" diff --git a/src/core/include/ngraph/ops.hpp b/src/core/include/ngraph/ops.hpp index 7b53802c93e..7b21ae3ad91 100644 --- a/src/core/include/ngraph/ops.hpp +++ b/src/core/include/ngraph/ops.hpp @@ -6,6 +6,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/op/abs.hpp" #include "ngraph/op/acos.hpp" #include "ngraph/op/acosh.hpp" diff --git a/src/core/include/ngraph/opsets/opset.hpp b/src/core/include/ngraph/opsets/opset.hpp index b4eb253b1d8..fce3a525e4b 100644 --- a/src/core/include/ngraph/opsets/opset.hpp +++ b/src/core/include/ngraph/opsets/opset.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -15,12 +25,15 @@ #include "ngraph/node.hpp" #include "openvino/opsets/opset.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { /// \brief Run-time opset information class NGRAPH_API OpSet : public ov::OpSet { public: explicit OpSet(const ov::OpSet& opset); + NGRAPH_SUPPRESS_DEPRECATED_START OpSet(const ngraph::OpSet& opset); + NGRAPH_SUPPRESS_DEPRECATED_END OpSet() = default; /// \brief Insert an op into the opset with a particular name and factory void insert(const std::string& name, const NodeTypeInfo& type_info, FactoryRegistry::Factory factory) { @@ -57,3 +70,4 @@ const NGRAPH_API OpSet& get_opset11(); const NGRAPH_API OpSet& get_opset12(); const NGRAPH_API std::map>& get_available_opsets(); } // namespace ngraph +NGRAPH_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/opsets/opset1.hpp b/src/core/include/ngraph/opsets/opset1.hpp index a240e3cfa09..42b3236287c 100644 --- a/src/core/include/ngraph/opsets/opset1.hpp +++ b/src/core/include/ngraph/opsets/opset1.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset10.hpp b/src/core/include/ngraph/opsets/opset10.hpp index f85e7e14200..66b248147ae 100644 --- a/src/core/include/ngraph/opsets/opset10.hpp +++ b/src/core/include/ngraph/opsets/opset10.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset11.hpp b/src/core/include/ngraph/opsets/opset11.hpp index 28ef99006e2..a4a36bd2fa2 100644 --- a/src/core/include/ngraph/opsets/opset11.hpp +++ b/src/core/include/ngraph/opsets/opset11.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset2.hpp b/src/core/include/ngraph/opsets/opset2.hpp index dd37982468d..898c8fdfc5c 100644 --- a/src/core/include/ngraph/opsets/opset2.hpp +++ b/src/core/include/ngraph/opsets/opset2.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" #include "ngraph/opsets/opset1.hpp" diff --git a/src/core/include/ngraph/opsets/opset3.hpp b/src/core/include/ngraph/opsets/opset3.hpp index bad9987f257..c2902c51163 100644 --- a/src/core/include/ngraph/opsets/opset3.hpp +++ b/src/core/include/ngraph/opsets/opset3.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset4.hpp b/src/core/include/ngraph/opsets/opset4.hpp index 9de68f7eaa8..14cb115f088 100644 --- a/src/core/include/ngraph/opsets/opset4.hpp +++ b/src/core/include/ngraph/opsets/opset4.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset5.hpp b/src/core/include/ngraph/opsets/opset5.hpp index 6edc3df9f8c..48cc80ef87c 100644 --- a/src/core/include/ngraph/opsets/opset5.hpp +++ b/src/core/include/ngraph/opsets/opset5.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset6.hpp b/src/core/include/ngraph/opsets/opset6.hpp index 34b5c17c667..29fbc432926 100644 --- a/src/core/include/ngraph/opsets/opset6.hpp +++ b/src/core/include/ngraph/opsets/opset6.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset7.hpp b/src/core/include/ngraph/opsets/opset7.hpp index 9907541dbbe..4ca9e2b94d3 100644 --- a/src/core/include/ngraph/opsets/opset7.hpp +++ b/src/core/include/ngraph/opsets/opset7.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset8.hpp b/src/core/include/ngraph/opsets/opset8.hpp index 77e69afde26..5b3e634d6fe 100644 --- a/src/core/include/ngraph/opsets/opset8.hpp +++ b/src/core/include/ngraph/opsets/opset8.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/opsets/opset9.hpp b/src/core/include/ngraph/opsets/opset9.hpp index cf6ba4b0183..78e5e5726d4 100644 --- a/src/core/include/ngraph/opsets/opset9.hpp +++ b/src/core/include/ngraph/opsets/opset9.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/ops.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/output_vector.hpp b/src/core/include/ngraph/output_vector.hpp index c75b942108f..f099751caa6 100644 --- a/src/core/include/ngraph/output_vector.hpp +++ b/src/core/include/ngraph/output_vector.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/partial_shape.hpp b/src/core/include/ngraph/partial_shape.hpp index dff02c7c14d..df5af7bce08 100644 --- a/src/core/include/ngraph/partial_shape.hpp +++ b/src/core/include/ngraph/partial_shape.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/attribute_adapter.hpp" #include "ngraph/dimension.hpp" #include "ngraph/op/util/attr_types.hpp" diff --git a/src/core/include/ngraph/pass/constant_folding.hpp b/src/core/include/ngraph/pass/constant_folding.hpp index fc774dfe53d..c6fee705e16 100644 --- a/src/core/include/ngraph/pass/constant_folding.hpp +++ b/src/core/include/ngraph/pass/constant_folding.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/pass/pass.hpp" #include "openvino/pass/constant_folding.hpp" diff --git a/src/core/include/ngraph/pass/convert_fp32_to_fp16.hpp b/src/core/include/ngraph/pass/convert_fp32_to_fp16.hpp index e2864e0b0fa..6036929fa2d 100644 --- a/src/core/include/ngraph/pass/convert_fp32_to_fp16.hpp +++ b/src/core/include/ngraph/pass/convert_fp32_to_fp16.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/pass/graph_rewrite.hpp" #include "openvino/pass/convert_fp32_to_fp16.hpp" diff --git a/src/core/include/ngraph/pass/graph_rewrite.hpp b/src/core/include/ngraph/pass/graph_rewrite.hpp index e01da4f334c..45007d449f5 100644 --- a/src/core/include/ngraph/pass/graph_rewrite.hpp +++ b/src/core/include/ngraph/pass/graph_rewrite.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -23,8 +33,7 @@ using ov::pass::BackwardGraphRewrite; using ov::pass::GraphRewrite; using ov::pass::MatcherPass; -class NGRAPH_DEPRECATED("Use MatcherPass or FunctionPass instead.") NGRAPH_API RecurrentGraphRewrite - : public FunctionPass { +class NGRAPH_API_DEPRECATED NGRAPH_API RecurrentGraphRewrite : public FunctionPass { public: RecurrentGraphRewrite(size_t num_iters = 10) : ModelPass(), m_num_iters(num_iters) {} diff --git a/src/core/include/ngraph/pass/low_latency.hpp b/src/core/include/ngraph/pass/low_latency.hpp index 2b75ff71d9b..d056ca285fe 100644 --- a/src/core/include/ngraph/pass/low_latency.hpp +++ b/src/core/include/ngraph/pass/low_latency.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include @@ -42,7 +52,7 @@ namespace pass { * by step, the states will store between inferences. */ -class NGRAPH_DEPRECATED("Use LowLatency2 instead.") NGRAPH_API LowLatency : public ngraph::pass::MatcherPass { +class NGRAPH_API_DEPRECATED NGRAPH_API LowLatency : public ngraph::pass::MatcherPass { public: NGRAPH_RTTI_DECLARATION; LowLatency(); diff --git a/src/core/include/ngraph/pass/manager.hpp b/src/core/include/ngraph/pass/manager.hpp index 0569eb0b3bf..20841617d94 100644 --- a/src/core/include/ngraph/pass/manager.hpp +++ b/src/core/include/ngraph/pass/manager.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/pass/pass.hpp b/src/core/include/ngraph/pass/pass.hpp index 63e0545b441..b9486934d09 100644 --- a/src/core/include/ngraph/pass/pass.hpp +++ b/src/core/include/ngraph/pass/pass.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -29,17 +39,17 @@ using ov::pass::Manager; using ov::pass::PassBase; using ov::pass::PassProperty; using ov::pass::PassPropertyMask; -NGRAPH_DEPRECATED("This variable is deprecated and will be removed soon.") +NGRAPH_API_DEPRECATED const PassPropertyMask all_pass_property_off; -class NGRAPH_DEPRECATED("Use MatcherPass or FunctionPass instead.") NGRAPH_API NodePass : public PassBase { +class NGRAPH_API_DEPRECATED NGRAPH_API NodePass : public PassBase { public: NGRAPH_RTTI_DECLARATION; ~NodePass() override; virtual bool run_on_node(std::shared_ptr) = 0; }; -enum class NGRAPH_DEPRECATED("FusionType is no longer used anywhere. Please do no use it.") FusionType : uint32_t { +enum class NGRAPH_API_DEPRECATED FusionType : uint32_t { //`DIFFERENTIABLE_FUSIONS` produce ops that support autodiff // i.e. implement `generate_adjoints` DIFFERENTIABLE_FUSIONS = 0x1, diff --git a/src/core/include/ngraph/pass/pass_config.hpp b/src/core/include/ngraph/pass/pass_config.hpp index 76f79ea06d1..f47bf9fa1c0 100644 --- a/src/core/include/ngraph/pass/pass_config.hpp +++ b/src/core/include/ngraph/pass/pass_config.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/pass/serialize.hpp b/src/core/include/ngraph/pass/serialize.hpp index 675d2fe8072..8577f2cda7f 100644 --- a/src/core/include/ngraph/pass/serialize.hpp +++ b/src/core/include/ngraph/pass/serialize.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/pass/pass.hpp" #include "openvino/pass/serialize.hpp" diff --git a/src/core/include/ngraph/pass/validate.hpp b/src/core/include/ngraph/pass/validate.hpp index 59036501f9b..518be610cf8 100644 --- a/src/core/include/ngraph/pass/validate.hpp +++ b/src/core/include/ngraph/pass/validate.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/pass/pass.hpp" #include "openvino/pass/validate.hpp" diff --git a/src/core/include/ngraph/pass/visualize_tree.hpp b/src/core/include/ngraph/pass/visualize_tree.hpp index 55130954a94..90b5f78f59f 100644 --- a/src/core/include/ngraph/pass/visualize_tree.hpp +++ b/src/core/include/ngraph/pass/visualize_tree.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/pattern/matcher.hpp b/src/core/include/ngraph/pattern/matcher.hpp index 6d7ec73fac3..fd45a86bbf1 100644 --- a/src/core/include/ngraph/pattern/matcher.hpp +++ b/src/core/include/ngraph/pattern/matcher.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include diff --git a/src/core/include/ngraph/pattern/op/any.hpp b/src/core/include/ngraph/pattern/op/any.hpp index 1faeb56b1fc..a7a5aaf194c 100644 --- a/src/core/include/ngraph/pattern/op/any.hpp +++ b/src/core/include/ngraph/pattern/op/any.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/any.hpp" diff --git a/src/core/include/ngraph/pattern/op/any_of.hpp b/src/core/include/ngraph/pattern/op/any_of.hpp index 60955518603..fbf6652f273 100644 --- a/src/core/include/ngraph/pattern/op/any_of.hpp +++ b/src/core/include/ngraph/pattern/op/any_of.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/any_of.hpp" diff --git a/src/core/include/ngraph/pattern/op/any_output.hpp b/src/core/include/ngraph/pattern/op/any_output.hpp index cd2d566d929..4f733d48d41 100644 --- a/src/core/include/ngraph/pattern/op/any_output.hpp +++ b/src/core/include/ngraph/pattern/op/any_output.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/any_output.hpp" diff --git a/src/core/include/ngraph/pattern/op/branch.hpp b/src/core/include/ngraph/pattern/op/branch.hpp index 4ce87366507..e93b7b1b009 100644 --- a/src/core/include/ngraph/pattern/op/branch.hpp +++ b/src/core/include/ngraph/pattern/op/branch.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/branch.hpp" diff --git a/src/core/include/ngraph/pattern/op/capture.hpp b/src/core/include/ngraph/pattern/op/capture.hpp index ee858648b30..25031c5c3cd 100644 --- a/src/core/include/ngraph/pattern/op/capture.hpp +++ b/src/core/include/ngraph/pattern/op/capture.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/capture.hpp" diff --git a/src/core/include/ngraph/pattern/op/label.hpp b/src/core/include/ngraph/pattern/op/label.hpp index 85476cf706b..c780effa313 100644 --- a/src/core/include/ngraph/pattern/op/label.hpp +++ b/src/core/include/ngraph/pattern/op/label.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/label.hpp" diff --git a/src/core/include/ngraph/pattern/op/or.hpp b/src/core/include/ngraph/pattern/op/or.hpp index 1de300efc89..2c6926aa7d9 100644 --- a/src/core/include/ngraph/pattern/op/or.hpp +++ b/src/core/include/ngraph/pattern/op/or.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/or.hpp" diff --git a/src/core/include/ngraph/pattern/op/pattern.hpp b/src/core/include/ngraph/pattern/op/pattern.hpp index f72b3ae5208..1ff997f306a 100644 --- a/src/core/include/ngraph/pattern/op/pattern.hpp +++ b/src/core/include/ngraph/pattern/op/pattern.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/node.hpp" diff --git a/src/core/include/ngraph/pattern/op/skip.hpp b/src/core/include/ngraph/pattern/op/skip.hpp index 825fd010ef5..9cfb2f967b0 100644 --- a/src/core/include/ngraph/pattern/op/skip.hpp +++ b/src/core/include/ngraph/pattern/op/skip.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/skip.hpp" diff --git a/src/core/include/ngraph/pattern/op/true.hpp b/src/core/include/ngraph/pattern/op/true.hpp index 0e1a96e0166..62a564a96f1 100644 --- a/src/core/include/ngraph/pattern/op/true.hpp +++ b/src/core/include/ngraph/pattern/op/true.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/true.hpp" diff --git a/src/core/include/ngraph/pattern/op/wrap_type.hpp b/src/core/include/ngraph/pattern/op/wrap_type.hpp index b49e4756e9d..50a3a781bc7 100644 --- a/src/core/include/ngraph/pattern/op/wrap_type.hpp +++ b/src/core/include/ngraph/pattern/op/wrap_type.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/node.hpp" #include "ngraph/pattern/op/pattern.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" diff --git a/src/core/include/ngraph/rank.hpp b/src/core/include/ngraph/rank.hpp index 153dabd4d59..24b0775f871 100644 --- a/src/core/include/ngraph/rank.hpp +++ b/src/core/include/ngraph/rank.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/dimension.hpp" #include "openvino/core/rank.hpp" diff --git a/src/core/include/ngraph/rt_info.hpp b/src/core/include/ngraph/rt_info.hpp index e68c670c105..5219856e42c 100644 --- a/src/core/include/ngraph/rt_info.hpp +++ b/src/core/include/ngraph/rt_info.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/ngraph_visibility.hpp" diff --git a/src/core/include/ngraph/shape.hpp b/src/core/include/ngraph/shape.hpp index d4aef598470..22019988861 100644 --- a/src/core/include/ngraph/shape.hpp +++ b/src/core/include/ngraph/shape.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/shape_util.hpp b/src/core/include/ngraph/shape_util.hpp index f72ffef9da4..4720d5b7719 100644 --- a/src/core/include/ngraph/shape_util.hpp +++ b/src/core/include/ngraph/shape_util.hpp @@ -4,11 +4,21 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/partial_shape.hpp" namespace ngraph { template -AXIS_VALUES project(const AXIS_VALUES& axis_values, const AxisSet& axes) { +NGRAPH_API_DEPRECATED AXIS_VALUES project(const AXIS_VALUES& axis_values, const AxisSet& axes) { AXIS_VALUES result; for (size_t i = 0; i < axis_values.size(); i++) { @@ -21,11 +31,11 @@ AXIS_VALUES project(const AXIS_VALUES& axis_values, const AxisSet& axes) { } template <> -NGRAPH_API PartialShape project(const PartialShape& shape, const AxisSet& axes); +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape project(const PartialShape& shape, const AxisSet& axes); // Removes some values from a vector of axis values template -AXIS_VALUES reduce(const AXIS_VALUES& axis_values, const AxisSet& deleted_axes, bool keep_dims) { +NGRAPH_API_DEPRECATED AXIS_VALUES reduce(const AXIS_VALUES& axis_values, const AxisSet& deleted_axes, bool keep_dims) { AXIS_VALUES result; for (size_t i = 0; i < axis_values.size(); i++) { @@ -41,14 +51,16 @@ AXIS_VALUES reduce(const AXIS_VALUES& axis_values, const AxisSet& deleted_axes, } template <> -NGRAPH_API PartialShape reduce(const PartialShape& shape, const AxisSet& deleted_axes, bool keep_dims); +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape reduce(const PartialShape& shape, + const AxisSet& deleted_axes, + bool keep_dims); // TODO: check validity, i.e. that the new axis indices are all less than // axis_values.size()+num_new_axes. // Add new values at particular axis positions template -AXIS_VALUES inject_pairs(const AXIS_VALUES& axis_values, - std::vector> new_axis_pos_value_pairs) { +NGRAPH_API_DEPRECATED AXIS_VALUES inject_pairs(const AXIS_VALUES& axis_values, + std::vector> new_axis_pos_value_pairs) { AXIS_VALUES result; size_t original_pos = 0; @@ -76,12 +88,12 @@ AXIS_VALUES inject_pairs(const AXIS_VALUES& axis_values, } template <> -NGRAPH_API PartialShape inject_pairs(const PartialShape& shape, - std::vector> new_axis_pos_value_pairs); +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape +inject_pairs(const PartialShape& shape, std::vector> new_axis_pos_value_pairs); // Add a new value at a particular axis position template -AXIS_VALUES inject(const AXIS_VALUES& axis_values, size_t new_axis_pos, AXIS_VALUE new_axis_val) { +NGRAPH_API_DEPRECATED AXIS_VALUES inject(const AXIS_VALUES& axis_values, size_t new_axis_pos, AXIS_VALUE new_axis_val) { return inject_pairs( axis_values, std::vector>{std::pair(new_axis_pos, new_axis_val)}); diff --git a/src/core/include/ngraph/slice_plan.hpp b/src/core/include/ngraph/slice_plan.hpp index 34dd1b8cfde..f86e95ec68e 100644 --- a/src/core/include/ngraph/slice_plan.hpp +++ b/src/core/include/ngraph/slice_plan.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/op/util/slice_plan.hpp" diff --git a/src/core/include/ngraph/specialize_function.hpp b/src/core/include/ngraph/specialize_function.hpp index 2cd642ab9ac..b428bb8e45f 100644 --- a/src/core/include/ngraph/specialize_function.hpp +++ b/src/core/include/ngraph/specialize_function.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/function.hpp" namespace ngraph { @@ -89,7 +99,7 @@ namespace ngraph { /// which a Constant node with element type parameter_element_types[i] and shape /// parameter_shapes[i] can be created. /// -NGRAPH_DEPRECATED("This function was deprecated. Please modify the original ov::Model instead.") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr specialize_function(std::shared_ptr f, const std::vector& parameter_element_types, diff --git a/src/core/include/ngraph/strides.hpp b/src/core/include/ngraph/strides.hpp index a35940926da..795469f0b04 100644 --- a/src/core/include/ngraph/strides.hpp +++ b/src/core/include/ngraph/strides.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include diff --git a/src/core/include/ngraph/type.hpp b/src/core/include/ngraph/type.hpp index 2e1351fd077..aa659c5b2f6 100644 --- a/src/core/include/ngraph/type.hpp +++ b/src/core/include/ngraph/type.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/type.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/type/bfloat16.hpp b/src/core/include/ngraph/type/bfloat16.hpp index 69ae0820c60..1a20346438c 100644 --- a/src/core/include/ngraph/type/bfloat16.hpp +++ b/src/core/include/ngraph/type/bfloat16.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/type/bfloat16.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/type/element_type.hpp b/src/core/include/ngraph/type/element_type.hpp index f1560ea7b5f..484aba40827 100644 --- a/src/core/include/ngraph/type/element_type.hpp +++ b/src/core/include/ngraph/type/element_type.hpp @@ -8,6 +8,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "ngraph/deprecated.hpp" #include "ngraph/type/bfloat16.hpp" #include "ngraph/type/float16.hpp" @@ -39,12 +49,12 @@ using ov::element::u8; using ov::element::undefined; template -Type from() { +NGRAPH_API_DEPRECATED Type from() { return ov::element::from(); } } // namespace element /// \brief Return the number of bytes in the compile-time representation of the element type. -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED size_t compiler_byte_size(element::Type_t et); } // namespace ngraph diff --git a/src/core/include/ngraph/type/element_type_traits.hpp b/src/core/include/ngraph/type/element_type_traits.hpp index f6f5d54597f..679b9aa025a 100644 --- a/src/core/include/ngraph/type/element_type_traits.hpp +++ b/src/core/include/ngraph/type/element_type_traits.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/type/element_type_traits.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/type/float16.hpp b/src/core/include/ngraph/type/float16.hpp index e206d9d3a02..93369ce3223 100644 --- a/src/core/include/ngraph/type/float16.hpp +++ b/src/core/include/ngraph/type/float16.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include "openvino/core/type/float16.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/util.hpp b/src/core/include/ngraph/util.hpp index a4fa60cfaa9..4af0e4cf758 100644 --- a/src/core/include/ngraph/util.hpp +++ b/src/core/include/ngraph/util.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include #include @@ -41,8 +51,9 @@ namespace runtime { class Tensor; } // namespace runtime +NGRAPH_SUPPRESS_DEPRECATED_START template -std::string join(const T& v, const std::string& sep = ", ") { +NGRAPH_API_DEPRECATED std::string join(const T& v, const std::string& sep = ", ") { std::ostringstream ss; size_t count = 0; for (const auto& x : v) { @@ -55,30 +66,33 @@ std::string join(const T& v, const std::string& sep = ", ") { } template -std::string vector_to_string(const T& v) { +NGRAPH_API_DEPRECATED std::string vector_to_string(const T& v) { std::ostringstream os; os << "[ " << ngraph::join(v) << " ]"; return os.str(); } NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED size_t hash_combine(const std::vector& list); NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED void dump(std::ostream& out, const void*, size_t); NGRAPH_API +NGRAPH_API_DEPRECATED std::string to_lower(const std::string& s); NGRAPH_API +NGRAPH_API_DEPRECATED std::string to_upper(const std::string& s); NGRAPH_API +NGRAPH_API_DEPRECATED std::string trim(const std::string& s); NGRAPH_API +NGRAPH_API_DEPRECATED std::vector split(const std::string& s, char delimiter, bool trim = false); template -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -std::string locale_string(T x) { +NGRAPH_API_DEPRECATED std::string locale_string(T x) { std::stringstream ss; ss.imbue(std::locale("")); ss << x; @@ -127,8 +141,7 @@ private: /// Parses a string containing a literal of the underlying type. template -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -T parse_string(const std::string& s) { +NGRAPH_API_DEPRECATED T parse_string(const std::string& s) { T result; std::stringstream ss; @@ -146,26 +159,21 @@ T parse_string(const std::string& s) { /// template specializations for float and double to handle INFINITY, -INFINITY /// and NaN values. template <> -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -NGRAPH_API float parse_string(const std::string& s); +NGRAPH_API_DEPRECATED NGRAPH_API float parse_string(const std::string& s); template <> -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -NGRAPH_API double parse_string(const std::string& s); +NGRAPH_API_DEPRECATED NGRAPH_API double parse_string(const std::string& s); /// template specializations for int8_t and uint8_t to handle the fact that default /// implementation ends up treating values as characters so that the number "0" turns into /// the parsed value 48, which is it's ASCII value template <> -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -NGRAPH_API int8_t parse_string(const std::string& s); +NGRAPH_API_DEPRECATED NGRAPH_API int8_t parse_string(const std::string& s); template <> -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -NGRAPH_API uint8_t parse_string(const std::string& s); +NGRAPH_API_DEPRECATED NGRAPH_API uint8_t parse_string(const std::string& s); /// Parses a list of strings containing literals of the underlying type. template -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -std::vector parse_string(const std::vector& ss) { +NGRAPH_API_DEPRECATED std::vector parse_string(const std::vector& ss) { NGRAPH_SUPPRESS_DEPRECATED_START std::vector result(ss.size()); std::transform(ss.begin(), ss.end(), result.begin(), [](const std::string& s) { @@ -176,37 +184,40 @@ std::vector parse_string(const std::vector& ss) { } template -T ceil_div(const T& x, const T& y) { +NGRAPH_API_DEPRECATED T ceil_div(const T& x, const T& y) { return (x == 0 ? 0 : (1 + (x - 1) / y)); } template -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") -T subtract_or_zero(T x, T y) { +NGRAPH_API_DEPRECATED T subtract_or_zero(T x, T y) { return y > x ? 0 : x - y; } NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED void* ngraph_malloc(size_t size); NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED void ngraph_free(void*); NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED size_t round_up(size_t size, size_t alignment); NGRAPH_API +NGRAPH_API_DEPRECATED AxisVector get_default_order(size_t rank); NGRAPH_API +NGRAPH_API_DEPRECATED AxisVector get_default_order(const Rank& rank); NGRAPH_API +NGRAPH_API_DEPRECATED AxisVector get_default_order(const Shape& shape); NGRAPH_API +NGRAPH_API_DEPRECATED AxisVector get_default_order(const PartialShape& shape); /// \brief Function to query parsed version information of the version of ngraph which @@ -221,11 +232,11 @@ AxisVector get_default_order(const PartialShape& shape); /// /// \note Throws a runtime_error if there is an error during parsing NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED void parse_version_string(std::string version, size_t& major, size_t& minor, size_t& patch, std::string& extra); template -T double_to_int(double x, double float_to_int_converter(double)) { +NGRAPH_API_DEPRECATED T double_to_int(double x, double float_to_int_converter(double)) { if (!std::is_integral()) { throw std::runtime_error("Function double_to_int template parameter must be an integral type."); } @@ -247,7 +258,7 @@ T double_to_int(double x, double float_to_int_converter(double)) { } // end namespace ngraph template -std::vector read_vector(std::shared_ptr tv) { +NGRAPH_API_DEPRECATED std::vector read_vector(std::shared_ptr tv) { if (ngraph::element::from() != tv->get_element_type()) { throw std::invalid_argument("read_vector type must match Tensor type"); } @@ -259,7 +270,8 @@ std::vector read_vector(std::shared_ptr tv) { } template -std::vector array_2_vector(typename ngraph::element_type_traits::value_type* data, size_t size) { +NGRAPH_API_DEPRECATED std::vector array_2_vector(typename ngraph::element_type_traits::value_type* data, + size_t size) { std::vector result(size); for (size_t i = 0; i < size; i++) { result[i] = static_cast(data[i]); @@ -267,7 +279,7 @@ std::vector array_2_vector(typename ngraph::element_type_traits::value_ty return result; } template -std::vector host_tensor_2_vector(ngraph::HostTensorPtr tensor) { +NGRAPH_API_DEPRECATED std::vector host_tensor_2_vector(ngraph::HostTensorPtr tensor) { NGRAPH_CHECK(tensor != nullptr, "Invalid Tensor received, can't read the data from a null pointer."); switch (tensor->get_element_type()) { @@ -331,9 +343,13 @@ std::vector host_tensor_2_vector(ngraph::HostTensorPtr tensor) { } } +NGRAPH_API_DEPRECATED std::vector NGRAPH_API read_float_vector(std::shared_ptr tv); +NGRAPH_API_DEPRECATED std::vector NGRAPH_API read_index_vector(std::shared_ptr tv); NGRAPH_API +NGRAPH_API_DEPRECATED std::ostream& operator<<(std::ostream& os, const ngraph::NodeVector& nv); +NGRAPH_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/validation_util.hpp b/src/core/include/ngraph/validation_util.hpp index 4aadf9d210c..1d403eebc19 100644 --- a/src/core/include/ngraph/validation_util.hpp +++ b/src/core/include/ngraph/validation_util.hpp @@ -4,6 +4,16 @@ #pragma once +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif + #include #include "ngraph/coordinate_diff.hpp" @@ -22,17 +32,17 @@ using ov::infer_convolution_forward; using ov::normalize_axes; using ov::normalize_axis; -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API Strides conv_default_strides(const Node* node, const PartialShape& data_batch_shape, const PartialShape& filters_shape); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API CoordinateDiff conv_default_padding(const Node* node, const PartialShape& data_batch_shape, const PartialShape& filters_shape); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape infer_windowed_reduction_output_shape(const Node* node, const PartialShape& data_shape, @@ -45,7 +55,7 @@ PartialShape infer_windowed_reduction_output_shape(const Node* node, bool is_window_all_in_padding_allowed, bool ceil_mode = false); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED void validate_conv_params_spatial_dimensions(const Node* node, const size_t num_spatial_dims, const op::PadType auto_pad, @@ -66,7 +76,7 @@ void validate_conv_params_spatial_dimensions(const Node* node, /// \param pads_end Pads end. /// /// \return Partial shape of the output. -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED PartialShape validate_and_infer_convolution_forward_output_shape(const Node* node, const Rank& result_ps_rank, const PartialShape& data_batch_pshape, @@ -77,7 +87,7 @@ PartialShape validate_and_infer_convolution_forward_output_shape(const Node* nod CoordinateDiff& pads_begin, CoordinateDiff& pads_end); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape infer_batched_pooling_forward(const Node* node, const PartialShape& data_batch_shape, @@ -89,7 +99,7 @@ PartialShape infer_batched_pooling_forward(const Node* node, bool ceil_mode = false, const Strides& window_dilation = Strides{}); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API std::tuple infer_batch_norm_forward(const Node* node, element::Type input_element_type, @@ -103,7 +113,7 @@ std::tuple infer_batch_norm_forward(c const PartialShape& mean_shape, const PartialShape& variance_shape); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API std::tuple infer_batch_norm_forward(const Node* node, element::Type input_element_type, @@ -127,7 +137,7 @@ std::tuple infer_batch_norm_forward(c /// /// \return true if auto padding was applied successfully (all needed informations such as /// spatial dims are known), false otherwise. -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API bool try_apply_auto_padding(const PartialShape& image_shape, const Shape& filter_shape, @@ -137,7 +147,7 @@ bool try_apply_auto_padding(const PartialShape& image_shape, CoordinateDiff& padding_above, CoordinateDiff& padding_below); -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API PartialShape infer_slice_shape(const Node* node, const PartialShape& input_shape, @@ -154,7 +164,7 @@ PartialShape infer_slice_shape(const Node* node, /// \return (true, max_value) if can be determined, or (false, numeric_limits::max()) /// if not. /// \deprecated Use evaluate_upper_bound instead -NGRAPH_DEPRECATED("Use evaluate_upper_bound: it would return HostTensorPtr to the value instead of a pair") +NGRAPH_API_DEPRECATED NGRAPH_API std::pair maximum_value(const Output& value); /// \brief Evaluates outputs, treating values in value_map as already computed. value_map is @@ -165,27 +175,27 @@ NGRAPH_API std::pair maximum_value(const Output& value); /// \param outputs Root set of values to try to compute /// \param evaluation_context Storage of additional settings and attributes that can be used /// when evaluating the function. This additional information can be shared across nodes. -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API void evaluate_nodes(std::map& value_map, std::map& output_tensor_map, const OutputVector& outputs, const EvaluationContext& evaluation_context = EvaluationContext()); /// \brief Returns a Constant storing scalar value equal to std::numeric_limits::max() -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr get_constant_max_of_type(element::Type_t t); /// \brief Returns a Constant storing scalar value equal to std::numeric_limits::min() -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr get_constant_min_of_type(element::Type_t t); /// \brief Returns a Constant storing scalar value equal to std::numeric_limits::lowest() -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API std::shared_ptr get_constant_lowest_of_type(element::Type_t t); /// \brief Checks if size of HostTensorVector is the same as passed size attribute. Then checks /// that all the HostTensorPtrs are not equal to nullptr -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API bool validate_host_tensor_vector(const HostTensorVector& v, const size_t& size); namespace opset1 { @@ -202,7 +212,7 @@ namespace opset1 { /// \param pads_begin The placeholder for paddings at the beginning of axis. /// \param pads_end The placeholder for paddings at the end of axis. /// -OPENVINO_DEPRECATED("This function is deprecated and will be moved to dev api in 2024.0 release.") +NGRAPH_API_DEPRECATED NGRAPH_API void infer_conv_backprop_auto_padding(const Shape& input_data_shape, const Shape& filters_shape, diff --git a/src/core/include/ngraph/version.hpp b/src/core/include/ngraph/version.hpp index 88002b7378a..109d795736c 100644 --- a/src/core/include/ngraph/version.hpp +++ b/src/core/include/ngraph/version.hpp @@ -1,6 +1,17 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once + +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif #include @@ -11,7 +22,7 @@ NGRAPH_EXTERN_C NGRAPH_API const char* NGRAPH_VERSION_NUMBER; // clang-format off extern "C" NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED const char* get_ngraph_version_string(); // clang-format on @@ -27,6 +38,6 @@ namespace ngraph { /// /// \note Throws a runtime_error if there is an error during parsing NGRAPH_API -NGRAPH_DEPRECATED("This method is deprecated and will be removed soon") +NGRAPH_API_DEPRECATED void get_version(size_t& major, size_t& minor, size_t& patch, std::string& extra); } // namespace ngraph diff --git a/src/core/include/ngraph/visibility.hpp b/src/core/include/ngraph/visibility.hpp index 3cf3f8e4002..cdfadee74e9 100644 --- a/src/core/include/ngraph/visibility.hpp +++ b/src/core/include/ngraph/visibility.hpp @@ -1,6 +1,17 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // +#pragma once + +#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) +# define NGRAPH_LEGACY_HEADER_INCLUDED +# ifdef _MSC_VER +# pragma message( \ + "The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# else +# warning("The nGraph API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") +# endif +#endif #include diff --git a/src/core/include/openvino/core/node.hpp b/src/core/include/openvino/core/node.hpp index 297ad4d9107..d1b8f400238 100644 --- a/src/core/include/openvino/core/node.hpp +++ b/src/core/include/openvino/core/node.hpp @@ -19,7 +19,6 @@ #include #include -#include "ngraph/op/util/op_annotations.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/core_visibility.hpp" #include "openvino/core/deprecated.hpp" diff --git a/src/core/include/openvino/op/constant.hpp b/src/core/include/openvino/op/constant.hpp index 16965609ab7..fd55cdcfef5 100644 --- a/src/core/include/openvino/op/constant.hpp +++ b/src/core/include/openvino/op/constant.hpp @@ -7,9 +7,19 @@ #include #include +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED_CONSTANT +#endif + #include "ngraph/runtime/aligned_buffer.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/shared_buffer.hpp" + +#ifdef WAS_OV_LIBRARY_DEFINED_CONSTANT +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED_CONSTANT +#endif #include "openvino/core/coordinate_diff.hpp" #include "openvino/core/node.hpp" #include "openvino/core/type/element_type.hpp" diff --git a/src/core/include/openvino/op/util/variable_value.hpp b/src/core/include/openvino/op/util/variable_value.hpp index f4a1f5fb972..75ee8d524ea 100644 --- a/src/core/include/openvino/op/util/variable_value.hpp +++ b/src/core/include/openvino/op/util/variable_value.hpp @@ -4,11 +4,24 @@ #pragma once +#include #include +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED_VARIABLE_VALUE +#endif + #include "ngraph/runtime/host_tensor.hpp" + +#ifdef WAS_OV_LIBRARY_DEFINED_VARIABLE_VALUE +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED_VARIABLE_VALUE +#endif + #include "openvino/core/core_visibility.hpp" #include "openvino/core/deprecated.hpp" +#include "openvino/runtime/tensor.hpp" namespace ov { namespace op { diff --git a/src/core/include/openvino/opsets/opset.hpp b/src/core/include/openvino/opsets/opset.hpp index aec2bc6436d..41d5cc5432f 100644 --- a/src/core/include/openvino/opsets/opset.hpp +++ b/src/core/include/openvino/opsets/opset.hpp @@ -14,6 +14,7 @@ #include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" +OPENVINO_SUPPRESS_DEPRECATED_START namespace ov { /** * @brief Run-time opset information @@ -34,7 +35,9 @@ public: /// \brief Insert OP_TYPE into the opset with a special name and the default factory template void insert(const std::string& name) { + OPENVINO_SUPPRESS_DEPRECATED_START insert(name, OP_TYPE::get_type_info_static(), ngraph::FactoryRegistry::get_default_factory()); + OPENVINO_SUPPRESS_DEPRECATED_END } /// \brief Insert OP_TYPE into the opset with the default name and factory @@ -183,3 +186,4 @@ const OPENVINO_API OpSet& get_opset12(); */ const OPENVINO_API std::map>& get_available_opsets(); } // namespace ov +OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/openvino/pass/serialize.hpp b/src/core/include/openvino/pass/serialize.hpp index a97e96a541e..691702a65f1 100644 --- a/src/core/include/openvino/pass/serialize.hpp +++ b/src/core/include/openvino/pass/serialize.hpp @@ -7,13 +7,24 @@ #include #include +#ifndef IN_OV_COMPONENT +# define IN_OV_COMPONENT +# define WAS_OV_LIBRARY_DEFINED_SERIALIZE +#endif + #include "ngraph/opsets/opset.hpp" + +#ifdef WAS_OV_LIBRARY_DEFINED_SERIALIZE +# undef IN_OV_COMPONENT +# undef WAS_OV_LIBRARY_DEFINED_SERIALIZE +#endif #include "openvino/core/model.hpp" #include "openvino/pass/pass.hpp" namespace ov { namespace pass { +OPENVINO_SUPPRESS_DEPRECATED_START /** * @brief Serialize transformation converts ngraph::Function into IR files * @attention @@ -93,6 +104,7 @@ private: std::function m_custom_data_serializer; const Serialize::Version m_version; }; +OPENVINO_SUPPRESS_DEPRECATED_END } // namespace pass } // namespace ov diff --git a/src/core/reference/include/ngraph/runtime/reference/autobroadcast_binop.hpp b/src/core/reference/include/ngraph/runtime/reference/autobroadcast_binop.hpp index 7b5f166fc67..6997669ef00 100644 --- a/src/core/reference/include/ngraph/runtime/reference/autobroadcast_binop.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/autobroadcast_binop.hpp @@ -378,9 +378,11 @@ void autobroadcast_select(const U* arg0, const auto output_strides = row_major_strides(output_shape); for (const Coordinate& output_coord : output_transform) { + NGRAPH_SUPPRESS_DEPRECATED_START const Coordinate arg0_coord = reduce(output_coord, arg0_squeezed_axes, false); const Coordinate arg1_coord = reduce(output_coord, arg1_squeezed_axes, false); const Coordinate arg2_coord = reduce(output_coord, arg2_squeezed_axes, false); + NGRAPH_SUPPRESS_DEPRECATED_END const size_t arg0_idx = std::inner_product(arg0_coord.begin(), arg0_coord.end(), arg0_strides.begin(), uint64_t(0)); @@ -455,8 +457,10 @@ void autobroadcast_select(const U* arg0, const auto output_strides = row_major_strides(arg1_shape); for (const Coordinate& output_coord : output_transform) { + NGRAPH_SUPPRESS_DEPRECATED_START const Coordinate arg0_coord = reduce(output_coord, arg0_squeezed_axes, false); const Coordinate arg2_coord = reduce(output_coord, arg2_squeezed_axes, false); + NGRAPH_SUPPRESS_DEPRECATED_END const size_t arg0_idx = std::inner_product(arg0_coord.begin(), arg0_coord.end(), arg0_strides.begin(), uint64_t(0)); diff --git a/src/core/reference/include/ngraph/runtime/reference/fake_quantize.hpp b/src/core/reference/include/ngraph/runtime/reference/fake_quantize.hpp index 2418ff92b47..cf98032f4c1 100644 --- a/src/core/reference/include/ngraph/runtime/reference/fake_quantize.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/fake_quantize.hpp @@ -157,11 +157,13 @@ void fake_quantize(const T* const arg, const auto output_strides = row_major_strides(output_shape); for (const Coordinate& output_coord : output_transform) { + OPENVINO_SUPPRESS_DEPRECATED_START const Coordinate arg0_coord = reduce(output_coord, arg0_squeezed_axes, false); const Coordinate arg1_coord = reduce(output_coord, arg1_squeezed_axes, false); const Coordinate arg2_coord = reduce(output_coord, arg2_squeezed_axes, false); const Coordinate arg3_coord = reduce(output_coord, arg3_squeezed_axes, false); const Coordinate arg4_coord = reduce(output_coord, arg4_squeezed_axes, false); + OPENVINO_SUPPRESS_DEPRECATED_END const size_t arg0_idx = std::inner_product(arg0_coord.begin(), arg0_coord.end(), arg0_strides.begin(), uint64_t(0)); diff --git a/src/core/reference/include/ngraph/runtime/reference/logical_reduction.hpp b/src/core/reference/include/ngraph/runtime/reference/logical_reduction.hpp index 756457e14d9..6dd21b5c040 100644 --- a/src/core/reference/include/ngraph/runtime/reference/logical_reduction.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/logical_reduction.hpp @@ -13,6 +13,7 @@ namespace ngraph { namespace runtime { namespace reference { +OPENVINO_SUPPRESS_DEPRECATED_START static inline void reduce_logical_and(const char* arg, char* out, const Shape& in_shape, @@ -56,6 +57,7 @@ static inline void reduce_logical_or(const char* arg, char* out, const Shape& in out[out_idx] = out[out_idx] || arg[in_idx]; } } +OPENVINO_SUPPRESS_DEPRECATED_END } // namespace reference } // namespace runtime } // namespace ngraph diff --git a/src/core/reference/include/ngraph/runtime/reference/max.hpp b/src/core/reference/include/ngraph/runtime/reference/max.hpp index 64750d4db08..76c249ca23d 100644 --- a/src/core/reference/include/ngraph/runtime/reference/max.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/max.hpp @@ -19,6 +19,7 @@ void max(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_a T minval = std::numeric_limits::lowest(); constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::fill(out, out + shape_size(out_shape), minval); @@ -40,6 +41,7 @@ void max(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_a out[out_idx] = x; } } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/include/ngraph/runtime/reference/mean.hpp b/src/core/reference/include/ngraph/runtime/reference/mean.hpp index c26dd689a3a..747ec733c4c 100644 --- a/src/core/reference/include/ngraph/runtime/reference/mean.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/mean.hpp @@ -21,6 +21,7 @@ namespace reference { template void mean(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_axes) { constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::vector cs(shape_size(out_shape), 0); std::fill(out, out + shape_size(out_shape), T(0)); @@ -47,6 +48,7 @@ void mean(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_ index_to_count_map[out_idx]++; } } + OPENVINO_SUPPRESS_DEPRECATED_END for (size_t i = 0; i < shape_size(out_shape); ++i) { auto count = index_to_count_map[i]; diff --git a/src/core/reference/include/ngraph/runtime/reference/min.hpp b/src/core/reference/include/ngraph/runtime/reference/min.hpp index 875480bf14f..db25a08558c 100644 --- a/src/core/reference/include/ngraph/runtime/reference/min.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/min.hpp @@ -24,6 +24,7 @@ void min(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_a std::numeric_limits::has_infinity ? std::numeric_limits::infinity() : std::numeric_limits::max(); constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::fill(out, out + shape_size(out_shape), minval); @@ -45,6 +46,7 @@ void min(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_a out[out_idx] = x; } } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/include/ngraph/runtime/reference/mvn.hpp b/src/core/reference/include/ngraph/runtime/reference/mvn.hpp index 8171a4b2f12..7ffc557b185 100644 --- a/src/core/reference/include/ngraph/runtime/reference/mvn.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/mvn.hpp @@ -18,6 +18,7 @@ namespace ngraph { namespace runtime { namespace reference { +OPENVINO_SUPPRESS_DEPRECATED_START template void mvn(const T* arg, T* out, @@ -86,6 +87,7 @@ void mvn_6(const T* arg, divide(out, tmp_buffer.data(), out, in_shape, reduced_shape, op::AutoBroadcastType::NUMPY, true); } } +OPENVINO_SUPPRESS_DEPRECATED_END template AxisSet mvn_6_reduction_axes(const ov::Tensor& axes_input, size_t rank) { diff --git a/src/core/reference/include/ngraph/runtime/reference/product.hpp b/src/core/reference/include/ngraph/runtime/reference/product.hpp index 3a369f0f57e..ff7d3a4a784 100644 --- a/src/core/reference/include/ngraph/runtime/reference/product.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/product.hpp @@ -16,6 +16,7 @@ namespace reference { template void product(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_axes) { constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::fill(out, out + shape_size(out_shape), T(1)); @@ -33,6 +34,7 @@ void product(const T* arg, T* out, const Shape& in_shape, const AxisSet& reducti out[out_idx] = out[out_idx] * arg[in_idx]; } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/include/ngraph/runtime/reference/reduce_l1.hpp b/src/core/reference/include/ngraph/runtime/reference/reduce_l1.hpp index 30a8ee12190..37477aa7e72 100644 --- a/src/core/reference/include/ngraph/runtime/reference/reduce_l1.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/reduce_l1.hpp @@ -16,6 +16,7 @@ namespace reference { template void reduce_l1(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_axes) { constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::fill(out, out + shape_size(out_shape), T(0)); @@ -33,6 +34,7 @@ void reduce_l1(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduc out[out_idx] = out[out_idx] + std::abs(arg[in_idx]); } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/include/ngraph/runtime/reference/reduce_l2.hpp b/src/core/reference/include/ngraph/runtime/reference/reduce_l2.hpp index fa204e488b5..c338f340be8 100644 --- a/src/core/reference/include/ngraph/runtime/reference/reduce_l2.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/reduce_l2.hpp @@ -16,6 +16,7 @@ namespace reference { template void reduce_l2(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_axes) { constexpr bool dont_keep_dims_in_output = false; + OPENVINO_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::fill(out, out + shape_size(out_shape), T(0)); @@ -36,6 +37,7 @@ void reduce_l2(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduc std::transform(out, out + shape_size(out_shape), out, [](T elem) { return sqrt(elem); }); + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/include/ngraph/runtime/reference/scatter_update.hpp b/src/core/reference/include/ngraph/runtime/reference/scatter_update.hpp index de776cfe301..1e60c3968b4 100644 --- a/src/core/reference/include/ngraph/runtime/reference/scatter_update.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/scatter_update.hpp @@ -23,10 +23,12 @@ static const CoordinateTransformBasic get_target_shape(const Shape& data_shape, AxisVector axis_order(m_n_axes); std::iota(axis_order.begin(), axis_order.end(), 0); const Strides strides(m_n_axes, 1); + OPENVINO_SUPPRESS_DEPRECATED_START for (size_t axis = 0; axis < m_n_axes; axis++) { target_shape.push_back( ceil_div(end_corner[axis_order[axis]] - start_corner[axis_order[axis]], strides[axis_order[axis]])); } + OPENVINO_SUPPRESS_DEPRECATED_END return target_shape; } diff --git a/src/core/reference/include/ngraph/runtime/reference/softmax.hpp b/src/core/reference/include/ngraph/runtime/reference/softmax.hpp index fbb058f0d52..9277d2a3c2b 100644 --- a/src/core/reference/include/ngraph/runtime/reference/softmax.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/softmax.hpp @@ -16,13 +16,13 @@ namespace runtime { namespace reference { template void softmax(const T* arg, T* out, const Shape& shape, const AxisSet& axes) { + NGRAPH_SUPPRESS_DEPRECATED_START auto temp_shape = reduce(shape, axes, true); auto temp_elements = shape_size(temp_shape); auto temp_ptr = new T[temp_elements]; max(arg, temp_ptr, shape, axes); - NGRAPH_SUPPRESS_DEPRECATED_START CoordinateTransform transform(shape); CoordinateTransform temp_transform(temp_shape); for (const Coordinate& coord : transform) { diff --git a/src/core/reference/include/ngraph/runtime/reference/strided_slice.hpp b/src/core/reference/include/ngraph/runtime/reference/strided_slice.hpp index 6348e6a1218..90c58f71b25 100644 --- a/src/core/reference/include/ngraph/runtime/reference/strided_slice.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/strided_slice.hpp @@ -17,7 +17,9 @@ namespace ngraph { namespace runtime { namespace reference { +NGRAPH_SUPPRESS_DEPRECATED_START void strided_slice(const char* arg, char* out, const Shape& arg_shape, const SlicePlan& sp, size_t elem_type); -} +NGRAPH_SUPPRESS_DEPRECATED_END +} // namespace reference } // namespace runtime } // namespace ngraph diff --git a/src/core/reference/include/ngraph/runtime/reference/sum.hpp b/src/core/reference/include/ngraph/runtime/reference/sum.hpp index 69132a80f0a..b7c3798eb50 100644 --- a/src/core/reference/include/ngraph/runtime/reference/sum.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/sum.hpp @@ -59,6 +59,7 @@ void kahan_summation(const T& elem, T& compensation, T& sum) { template void sum(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_axes) { constexpr bool dont_keep_dims_in_output = false; + NGRAPH_SUPPRESS_DEPRECATED_START const auto out_shape = reduce(in_shape, reduction_axes, dont_keep_dims_in_output); std::vector cs(shape_size(out_shape), 0); @@ -78,6 +79,7 @@ void sum(const T* arg, T* out, const Shape& in_shape, const AxisSet& reduction_a details::kahan_summation(arg[in_idx], cs[out_idx], out[out_idx]); } + NGRAPH_SUPPRESS_DEPRECATED_END } } // namespace reference } // namespace runtime diff --git a/src/core/reference/src/runtime/reference/einsum.cpp b/src/core/reference/src/runtime/reference/einsum.cpp index 8d168c91a83..2c44cfe8b96 100644 --- a/src/core/reference/src/runtime/reference/einsum.cpp +++ b/src/core/reference/src/runtime/reference/einsum.cpp @@ -16,6 +16,7 @@ #include "ngraph/runtime/reference/utils/span.hpp" #include "ngraph/shape.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START namespace ngraph { namespace runtime { namespace reference { diff --git a/src/core/reference/src/runtime/reference/strided_slice.cpp b/src/core/reference/src/runtime/reference/strided_slice.cpp index ad91cd31a74..fb97d98f42b 100644 --- a/src/core/reference/src/runtime/reference/strided_slice.cpp +++ b/src/core/reference/src/runtime/reference/strided_slice.cpp @@ -12,6 +12,7 @@ #include "ngraph/runtime/aligned_buffer.hpp" using namespace ngraph; +NGRAPH_SUPPRESS_DEPRECATED_START void runtime::reference::strided_slice(const char* arg, char* out, diff --git a/src/core/shape_inference/include/one_hot_shape_inference.hpp b/src/core/shape_inference/include/one_hot_shape_inference.hpp index 3cc3d2c5e4a..3da491e3d60 100644 --- a/src/core/shape_inference/include/one_hot_shape_inference.hpp +++ b/src/core/shape_inference/include/one_hot_shape_inference.hpp @@ -14,6 +14,7 @@ namespace v1 { namespace utils { namespace one_hot { +OPENVINO_SUPPRESS_DEPRECATED_START template inline bool get_data_as_shape_and_validate_sign( size_t idx, @@ -53,6 +54,7 @@ inline bool get_data_as_shape_and_validate_sign( OPENVINO_SUPPRESS_DEPRECATED_END } } +OPENVINO_SUPPRESS_DEPRECATED_END } // namespace one_hot } // namespace utils diff --git a/src/core/shape_inference/src/tensor_data_accessor.cpp b/src/core/shape_inference/src/tensor_data_accessor.cpp index 6d90dee024a..492295c8522 100644 --- a/src/core/shape_inference/src/tensor_data_accessor.cpp +++ b/src/core/shape_inference/src/tensor_data_accessor.cpp @@ -4,6 +4,8 @@ #include "tensor_data_accessor.hpp" +#include "ngraph/runtime/host_tensor.hpp" + namespace ov { template <> Tensor TensorAccessor::operator()(size_t port) const { diff --git a/src/core/src/axis_set.cpp b/src/core/src/axis_set.cpp index f5d999d4c35..f82aa43ef9e 100644 --- a/src/core/src/axis_set.cpp +++ b/src/core/src/axis_set.cpp @@ -32,7 +32,9 @@ std::vector ov::AxisSet::to_vector() const { std::ostream& ov::operator<<(std::ostream& s, const AxisSet& axis_set) { s << "AxisSet{"; + OPENVINO_SUPPRESS_DEPRECATED_START s << ngraph::join(axis_set); + OPENVINO_SUPPRESS_DEPRECATED_END s << "}"; return s; } diff --git a/src/core/src/axis_vector.cpp b/src/core/src/axis_vector.cpp index 6e8fc833b70..6f576f79abb 100644 --- a/src/core/src/axis_vector.cpp +++ b/src/core/src/axis_vector.cpp @@ -8,7 +8,9 @@ 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 << "}"; return s; } diff --git a/src/core/src/coordinate.cpp b/src/core/src/coordinate.cpp index 002eda2eca5..555e086333d 100644 --- a/src/core/src/coordinate.cpp +++ b/src/core/src/coordinate.cpp @@ -10,7 +10,9 @@ using namespace std; std::ostream& ov::operator<<(std::ostream& s, const Coordinate& coordinate) { s << "Coordinate{"; + OPENVINO_SUPPRESS_DEPRECATED_START s << ngraph::join(coordinate); + OPENVINO_SUPPRESS_DEPRECATED_END s << "}"; return s; } diff --git a/src/core/src/coordinate_diff.cpp b/src/core/src/coordinate_diff.cpp index 24941560b2d..cad621541c8 100644 --- a/src/core/src/coordinate_diff.cpp +++ b/src/core/src/coordinate_diff.cpp @@ -11,7 +11,9 @@ using namespace ngraph; std::ostream& ov::operator<<(std::ostream& s, const CoordinateDiff& coordinate_diff) { s << "CoordinateDiff{"; + OPENVINO_SUPPRESS_DEPRECATED_START s << ngraph::join(coordinate_diff); + OPENVINO_SUPPRESS_DEPRECATED_END s << "}"; return s; } diff --git a/src/core/src/factory.cpp b/src/core/src/factory.cpp index 639f878f168..4dcb7446c71 100644 --- a/src/core/src/factory.cpp +++ b/src/core/src/factory.cpp @@ -11,9 +11,15 @@ using namespace std; +NGRAPH_SUPPRESS_DEPRECATED_START + namespace ngraph { mutex& get_registry_mutex() { static mutex registry_mutex; return registry_mutex; } + +#ifndef _WIN32 +template class FactoryRegistry; +#endif } // namespace ngraph diff --git a/src/core/src/layout.cpp b/src/core/src/layout.cpp index 7d0e8e28c75..50089228ac6 100644 --- a/src/core/src/layout.cpp +++ b/src/core/src/layout.cpp @@ -12,6 +12,7 @@ #include "ngraph/util.hpp" namespace ov { +OPENVINO_SUPPRESS_DEPRECATED_START ///////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp index c195b680297..84db4210dcd 100644 --- a/src/core/src/node.cpp +++ b/src/core/src/node.cpp @@ -26,6 +26,8 @@ using namespace std; +NGRAPH_SUPPRESS_DEPRECATED_START + void ov::NodeValidationFailure::create(const CheckLocInfo& check_loc_info, const Node* node, const std::string& explanation) { @@ -501,9 +503,11 @@ ov::NodeVector ov::Node::get_users(bool check_is_used) const { for (const auto& output : outputs()) { for (auto input : output.get_target_inputs()) { Node* input_node = input.get_node(); + OPENVINO_SUPPRESS_DEPRECATED_START if (!check_is_used || ngraph::is_used(input_node)) { result.push_back(input_node->shared_from_this()); } + OPENVINO_SUPPRESS_DEPRECATED_END } } return result; diff --git a/src/core/src/op/batch_to_space.cpp b/src/core/src/op/batch_to_space.cpp index cb52b92c68f..9fc1b82c4c7 100644 --- a/src/core/src/op/batch_to_space.cpp +++ b/src/core/src/op/batch_to_space.cpp @@ -159,6 +159,7 @@ bool batch_to_space_evaluate(const HostTensorVector& outputs, const HostTensorVe begins.assign(crops_begin_values, crops_begin_values + shape_size(inputs[2]->get_shape())); std::vector default_strides(begins.size(), 1); + OPENVINO_SUPPRESS_DEPRECATED_START SlicePlan slice_plan = make_slice_plan(data_shape, begins, upperbounds_values, @@ -169,6 +170,7 @@ bool batch_to_space_evaluate(const HostTensorVector& outputs, const HostTensorVe AxisSet(), AxisSet()); runtime::reference::strided_slice(flat_data, outputs[0]->get_data_ptr(), data_shape, slice_plan, elem_size); + OPENVINO_SUPPRESS_DEPRECATED_END return true; } } // namespace diff --git a/src/core/src/op/clamp.cpp b/src/core/src/op/clamp.cpp index 797bddaa135..eb2acb43eb5 100644 --- a/src/core/src/op/clamp.cpp +++ b/src/core/src/op/clamp.cpp @@ -32,6 +32,7 @@ bool evaluate_clamp(const HostTensorPtr& arg, const HostTensorPtr& out, double m }; bool rc = true; + OPENVINO_SUPPRESS_DEPRECATED_START switch (arg->get_element_type()) { TYPE_CASE(i8) (arg, out, double_to_int(min, ceil_func), double_to_int(max, floor_func), count); @@ -69,6 +70,7 @@ bool evaluate_clamp(const HostTensorPtr& arg, const HostTensorPtr& out, double m break; } return rc; + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace } // namespace clamp diff --git a/src/core/src/op/loop.cpp b/src/core/src/op/loop.cpp index ef1f3b6ccdb..fe10f18e0af 100644 --- a/src/core/src/op/loop.cpp +++ b/src/core/src/op/loop.cpp @@ -377,7 +377,7 @@ void op::v5::Loop::clone_to(op::v5::Loop& dst, const OutputVector& new_args) con dst.m_num_iterations = m_num_iterations; dst.m_special_body_ports = m_special_body_ports; - dst.m_bodies[0] = clone_function(*get_function()); + dst.m_bodies[0] = get_function()->clone(); for (auto& input_description : m_input_descriptions[0]) { dst.m_input_descriptions[0].push_back(input_description->copy()); diff --git a/src/core/src/op/lstm_sequence.cpp b/src/core/src/op/lstm_sequence.cpp index 8f2f2e8e31a..a23263d60cb 100644 --- a/src/core/src/op/lstm_sequence.cpp +++ b/src/core/src/op/lstm_sequence.cpp @@ -184,7 +184,9 @@ void op::v0::LSTMSequence::validate_and_infer_types() { const auto& b_pshape = get_input_partial_shape(6); const auto& p_pshape = get_input_partial_shape(7); + OPENVINO_SUPPRESS_DEPRECATED_START ngraph::op::util::validate_seq_input_rank_dimension(input_param); + OPENVINO_SUPPRESS_DEPRECATED_END // Validate rank and dimension for initial_cell_state input NODE_VALIDATION_CHECK(this, @@ -380,7 +382,9 @@ void op::v5::LSTMSequence::validate_and_infer_types() { const auto& r_pshape = get_input_partial_shape(5); const auto& b_pshape = get_input_partial_shape(6); + OPENVINO_SUPPRESS_DEPRECATED_START ngraph::op::util::validate_seq_input_rank_dimension(input_param); + OPENVINO_SUPPRESS_DEPRECATED_END // Validate rank and dimension for initial_cell_state input NODE_VALIDATION_CHECK(this, diff --git a/src/core/src/op/reduce_l1.cpp b/src/core/src/op/reduce_l1.cpp index 622bc457851..74d522a47f8 100644 --- a/src/core/src/op/reduce_l1.cpp +++ b/src/core/src/op/reduce_l1.cpp @@ -31,7 +31,9 @@ namespace reduce_l1 { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::reduce_l1(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -58,10 +60,10 @@ bool op::v4::ReduceL1::evaluate(const HostTensorVector& outputs, const HostTenso OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_l1::evaluate_sum(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_l2.cpp b/src/core/src/op/reduce_l2.cpp index 6a59a62885a..a56160415de 100644 --- a/src/core/src/op/reduce_l2.cpp +++ b/src/core/src/op/reduce_l2.cpp @@ -31,7 +31,9 @@ namespace reduce_l2 { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::reduce_l2(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -56,10 +58,10 @@ bool op::v4::ReduceL2::evaluate(const HostTensorVector& outputs, const HostTenso OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_l2::evaluate_reduce_l2(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_logical_and.cpp b/src/core/src/op/reduce_logical_and.cpp index 7033f76a78f..fd177f67c3e 100644 --- a/src/core/src/op/reduce_logical_and.cpp +++ b/src/core/src/op/reduce_logical_and.cpp @@ -11,6 +11,7 @@ #include "ngraph/op/util/evaluate_helpers.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/logical_reduction.hpp" +#include "openvino/util/log.hpp" using namespace ngraph; using namespace std; @@ -34,6 +35,7 @@ bool evaluate_reduce_logical_and(const HostTensorPtr& data, const HostTensorPtr& out, const AxisSet& reduction_axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(data->get_shape(), reduction_axes, keep_dims)); try { runtime::reference::reduce_logical_and(data->get_data_ptr(), @@ -42,9 +44,10 @@ bool evaluate_reduce_logical_and(const HostTensorPtr& data, reduction_axes); return true; } catch (const ngraph_error& e) { - NGRAPH_WARN << e.what(); + OPENVINO_WARN << e.what(); return false; } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace } // namespace reduce_and @@ -54,7 +57,6 @@ bool op::v1::ReduceLogicalAnd::evaluate(const HostTensorVector& outputs, const H OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto& data = inputs[0]; const auto& axes = inputs[1]; @@ -64,6 +66,7 @@ bool op::v1::ReduceLogicalAnd::evaluate(const HostTensorVector& outputs, const H } const auto reduction_axes = get_normalized_axes_from_tensor(axes, data->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_and::evaluate_reduce_logical_and(data, out, reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_logical_or.cpp b/src/core/src/op/reduce_logical_or.cpp index e401d7d27a5..68cce39c8cd 100644 --- a/src/core/src/op/reduce_logical_or.cpp +++ b/src/core/src/op/reduce_logical_or.cpp @@ -11,6 +11,7 @@ #include "ngraph/op/util/evaluate_helpers.hpp" #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/logical_reduction.hpp" +#include "openvino/util/log.hpp" using namespace ngraph; using namespace std; @@ -34,6 +35,7 @@ bool evaluate_reduce_logical_or(const HostTensorPtr& data, const HostTensorPtr& out, const AxisSet& reduction_axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(data->get_shape(), reduction_axes, keep_dims)); try { runtime::reference::reduce_logical_or(data->get_data_ptr(), @@ -42,9 +44,10 @@ bool evaluate_reduce_logical_or(const HostTensorPtr& data, reduction_axes); return true; } catch (const ngraph_error& e) { - NGRAPH_WARN << e.what(); + OPENVINO_WARN << e.what(); return false; } + OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace } // namespace reduce_or @@ -54,7 +57,6 @@ bool op::v1::ReduceLogicalOr::evaluate(const HostTensorVector& outputs, const Ho OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto& data = inputs[0]; const auto& axes = inputs[1]; @@ -64,6 +66,7 @@ bool op::v1::ReduceLogicalOr::evaluate(const HostTensorVector& outputs, const Ho } const auto reduction_axes = get_normalized_axes_from_tensor(axes, data->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_or::evaluate_reduce_logical_or(data, out, reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_max.cpp b/src/core/src/op/reduce_max.cpp index 8504a7810de..6869bd38882 100644 --- a/src/core/src/op/reduce_max.cpp +++ b/src/core/src/op/reduce_max.cpp @@ -20,7 +20,9 @@ namespace maxop { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::max(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -61,10 +63,10 @@ bool op::v1::ReduceMax::evaluate(const HostTensorVector& outputs, const HostTens OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return maxop::evaluate_max(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_mean.cpp b/src/core/src/op/reduce_mean.cpp index 48885583431..6bda6f54448 100644 --- a/src/core/src/op/reduce_mean.cpp +++ b/src/core/src/op/reduce_mean.cpp @@ -32,7 +32,9 @@ namespace mean { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::mean(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -60,10 +62,10 @@ bool op::v1::ReduceMean::evaluate(const HostTensorVector& outputs, const HostTen OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return mean::evaluate_mean(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_min.cpp b/src/core/src/op/reduce_min.cpp index 0bc74d92232..8ee9624c7bc 100644 --- a/src/core/src/op/reduce_min.cpp +++ b/src/core/src/op/reduce_min.cpp @@ -19,7 +19,9 @@ namespace minop { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, const bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::min(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -60,10 +62,10 @@ bool op::v1::ReduceMin::evaluate(const HostTensorVector& outputs, const HostTens OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return minop::evaluate_min(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_prod.cpp b/src/core/src/op/reduce_prod.cpp index fd7a67dc370..15b3f2b650f 100644 --- a/src/core/src/op/reduce_prod.cpp +++ b/src/core/src/op/reduce_prod.cpp @@ -30,7 +30,9 @@ namespace reduce_prod { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::product(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -58,10 +60,10 @@ bool op::v1::ReduceProd::evaluate(const HostTensorVector& outputs, const HostTen OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_prod::evaluate_product(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reduce_sum.cpp b/src/core/src/op/reduce_sum.cpp index e945b7ecafc..360d7f245fa 100644 --- a/src/core/src/op/reduce_sum.cpp +++ b/src/core/src/op/reduce_sum.cpp @@ -33,7 +33,9 @@ namespace reduce_sum { namespace { template bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes, bool keep_dims) { + OPENVINO_SUPPRESS_DEPRECATED_START out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); + OPENVINO_SUPPRESS_DEPRECATED_END runtime::reference::sum(arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } @@ -61,10 +63,10 @@ bool op::v1::ReduceSum::evaluate(const HostTensorVector& outputs, const HostTens OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_CHECK(validate_host_tensor_vector(inputs, 2)); NGRAPH_CHECK(validate_host_tensor_vector(outputs, 1)); - OPENVINO_SUPPRESS_DEPRECATED_END const auto reduction_axes = get_normalized_axes_from_tensor(inputs[1], inputs[0]->get_partial_shape().rank(), get_friendly_name()); + OPENVINO_SUPPRESS_DEPRECATED_END return reduce_sum::evaluate_sum(inputs[0], outputs[0], reduction_axes, get_keep_dims()); } diff --git a/src/core/src/op/reshape.cpp b/src/core/src/op/reshape.cpp index 62c03dc6388..19301fc9fe5 100644 --- a/src/core/src/op/reshape.cpp +++ b/src/core/src/op/reshape.cpp @@ -184,7 +184,9 @@ bool op::v1::Reshape::evaluate_reshape(const HostTensorVector& outputs, const Ho NGRAPH_CHECK(ov::PartialShape(output_shape).is_static()); outputs[0]->set_shape(ov::PartialShape(output_shape).to_shape()); + OPENVINO_SUPPRESS_DEPRECATED_START const AxisVector order = get_default_order(inputs[0]->get_shape()); + OPENVINO_SUPPRESS_DEPRECATED_END return reshapeop::evaluate_reshape(inputs[0], outputs[0], order); } diff --git a/src/core/src/op/rnn_sequence.cpp b/src/core/src/op/rnn_sequence.cpp index 7183250ff3c..e9dcd4b692d 100644 --- a/src/core/src/op/rnn_sequence.cpp +++ b/src/core/src/op/rnn_sequence.cpp @@ -62,7 +62,9 @@ void op::v5::RNNSequence::validate_and_infer_types() { auto r_pshape = get_input_partial_shape(4); auto b_pshape = get_input_partial_shape(5); + OPENVINO_SUPPRESS_DEPRECATED_START ngraph::op::util::validate_seq_input_rank_dimension({x_pshape, ht_pshape, sl_pshape, w_pshape, r_pshape, b_pshape}); + OPENVINO_SUPPRESS_DEPRECATED_END // Validate input types and save result for output type NODE_VALIDATION_CHECK(this, diff --git a/src/core/src/op/scatter_elements_update.cpp b/src/core/src/op/scatter_elements_update.cpp index 721ef2255ce..be059a53857 100644 --- a/src/core/src/op/scatter_elements_update.cpp +++ b/src/core/src/op/scatter_elements_update.cpp @@ -194,7 +194,9 @@ bool op::v3::ScatterElementsUpdate::evaluate_scatter_element_update(const HostTe const HostTensorVector& inputs) const { NGRAPH_CHECK(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]; + OPENVINO_SUPPRESS_DEPRECATED_END const auto& input_rank = get_input_partial_shape(0).rank(); int64_t normalized_axis = axis; diff --git a/src/core/src/op/scatter_update.cpp b/src/core/src/op/scatter_update.cpp index 2d3cb0c28eb..31a953ad846 100644 --- a/src/core/src/op/scatter_update.cpp +++ b/src/core/src/op/scatter_update.cpp @@ -56,12 +56,12 @@ bool op::v3::ScatterUpdate::evaluate_scatter_update(const HostTensorVector& outp NGRAPH_CHECK(axis->get_element_type().is_integral_number(), "axis element type is not integral data type"); + OPENVINO_SUPPRESS_DEPRECATED_START int64_t axis_val = host_tensor_2_vector(axis)[0]; if (axis_val < 0) { - OPENVINO_SUPPRESS_DEPRECATED_START axis_val = ngraph::normalize_axis(this, axis_val, static_cast(data->get_shape().size())); - OPENVINO_SUPPRESS_DEPRECATED_END } + OPENVINO_SUPPRESS_DEPRECATED_END std::vector indices_casted_vector; switch (indices->get_element_type()) { diff --git a/src/core/src/op/slice.cpp b/src/core/src/op/slice.cpp index 4d313913ff4..f7812f22ee3 100644 --- a/src/core/src/op/slice.cpp +++ b/src/core/src/op/slice.cpp @@ -163,6 +163,7 @@ bool op::v8::Slice::evaluate(const HostTensorVector& outputs, const HostTensorVe constant_data.emplace(i, tensor); } + OPENVINO_SUPPRESS_DEPRECATED_START const auto starts = host_tensor_2_vector(inputs[1]); const auto stops = host_tensor_2_vector(inputs[2]); const auto steps = host_tensor_2_vector(inputs[3]); @@ -174,6 +175,7 @@ bool op::v8::Slice::evaluate(const HostTensorVector& outputs, const HostTensorVe } else { axes = host_tensor_2_vector(inputs[4]); } + OPENVINO_SUPPRESS_DEPRECATED_END auto output_shapes = std::vector(1); shape_infer(this, input_shapes, output_shapes, constant_data); diff --git a/src/core/src/op/split.cpp b/src/core/src/op/split.cpp index e13ac15a098..fb18079a29a 100644 --- a/src/core/src/op/split.cpp +++ b/src/core/src/op/split.cpp @@ -88,8 +88,8 @@ bool op::v1::Split::evaluate(const HostTensorVector& outputs, const HostTensorVe outputs_data[i] = outputs[i]->get_data_ptr(); } - auto axis = host_tensor_2_vector(axis_tensor)[0]; OPENVINO_SUPPRESS_DEPRECATED_START + auto axis = host_tensor_2_vector(axis_tensor)[0]; axis = normalize_axis(this, axis, data_tensor->get_partial_shape().rank()); OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/src/op/strided_slice.cpp b/src/core/src/op/strided_slice.cpp index cba7b37a10e..63b8cb185fb 100644 --- a/src/core/src/op/strided_slice.cpp +++ b/src/core/src/op/strided_slice.cpp @@ -191,6 +191,7 @@ shared_ptr op::v1::StridedSlice::clone_with_new_inputs(const OutputVector& namespace strided_slice { namespace { +OPENVINO_SUPPRESS_DEPRECATED_START inline bool evaluate(const HostTensorPtr& in, const SlicePlan& sp, const HostTensorPtr& out) { @@ -228,6 +229,7 @@ bool evaluate_strided_slice(const HostTensorPtr& in, ellipsis_mask); return evaluate(in, slice_plan, out); } +OPENVINO_SUPPRESS_DEPRECATED_END } // namespace } // namespace strided_slice diff --git a/src/core/src/op/tensor_iterator.cpp b/src/core/src/op/tensor_iterator.cpp index 89e7f0ec2a1..1553b74fedd 100644 --- a/src/core/src/op/tensor_iterator.cpp +++ b/src/core/src/op/tensor_iterator.cpp @@ -194,7 +194,7 @@ std::shared_ptr op::v0::TensorIterator::clone_with_new_inputs(const Output op->set_output_size(m_output_descriptions.size()); op->m_num_iterations = m_num_iterations; - op->m_bodies[0] = clone_function(*get_function()); + op->m_bodies[0] = get_function()->clone(); for (auto& input_description : m_input_descriptions[0]) { op->m_input_descriptions[0].push_back(input_description->copy()); diff --git a/src/core/src/op/tile.cpp b/src/core/src/op/tile.cpp index cb03266b506..1d5709713b5 100644 --- a/src/core/src/op/tile.cpp +++ b/src/core/src/op/tile.cpp @@ -54,7 +54,9 @@ bool op::v0::Tile::evaluate_tile(const HostTensorVector& outputs, const HostTens const auto& data = inputs[0]; const auto& axis = inputs[1]; auto& output = outputs[0]; + OPENVINO_SUPPRESS_DEPRECATED_START auto repeats_val = read_index_vector(axis); + OPENVINO_SUPPRESS_DEPRECATED_END const auto repeats_rank = repeats_val.size(); const auto input_shapes = std::vector{data->get_shape(), axis->get_shape()}; diff --git a/src/core/src/op/transpose.cpp b/src/core/src/op/transpose.cpp index a161552b0de..6b2ad190dd4 100644 --- a/src/core/src/op/transpose.cpp +++ b/src/core/src/op/transpose.cpp @@ -64,7 +64,9 @@ bool op::v1::Transpose::evaluate(const HostTensorVector& output_values, const Ho "Transpose axis element type has to be integral data type."); const auto& arg = input_values[ARG]; + OPENVINO_SUPPRESS_DEPRECATED_START std::vector axes_order = host_tensor_2_vector(order); + OPENVINO_SUPPRESS_DEPRECATED_END auto out_shape = calc_output_shape(this, arg->get_shape(), axes_order); auto& out = output_values[ARG_T]; diff --git a/src/core/src/op/unsqueeze.cpp b/src/core/src/op/unsqueeze.cpp index ddeef24b8ce..fb8a14994b1 100644 --- a/src/core/src/op/unsqueeze.cpp +++ b/src/core/src/op/unsqueeze.cpp @@ -71,8 +71,8 @@ bool evaluate_unsqueeze(const Node* node, const auto out_rank = static_cast(data_shape.size() + shape_size(axes_shape)); // Get axes and normalize - auto axes = read_index_vector(arg1); OPENVINO_SUPPRESS_DEPRECATED_START + auto axes = read_index_vector(arg1); normalize_axes(node, out_rank, axes); OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/src/op/util/evaluate_helpers.cpp b/src/core/src/op/util/evaluate_helpers.cpp index 80e62644e05..cffc57e6fbd 100644 --- a/src/core/src/op/util/evaluate_helpers.cpp +++ b/src/core/src/op/util/evaluate_helpers.cpp @@ -8,8 +8,8 @@ namespace ngraph { AxisSet get_normalized_axes_from_tensor(const HostTensorPtr tensor, const ngraph::Rank& rank, const std::string& node_description) { - const auto axes_vector = host_tensor_2_vector(tensor); OPENVINO_SUPPRESS_DEPRECATED_START + const auto axes_vector = host_tensor_2_vector(tensor); const auto normalized_axes = ngraph::normalize_axes(node_description, axes_vector, rank); OPENVINO_SUPPRESS_DEPRECATED_END return AxisSet{normalized_axes}; diff --git a/src/core/src/op/util/rnn_cell_base.cpp b/src/core/src/op/util/rnn_cell_base.cpp index 054520a20ef..e2284677d89 100644 --- a/src/core/src/op/util/rnn_cell_base.cpp +++ b/src/core/src/op/util/rnn_cell_base.cpp @@ -69,7 +69,9 @@ std::shared_ptr ov::op::util::convert_lstm_peepholes_format(const Outp 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 }); return res; } diff --git a/src/core/src/op/util/slice_plan.cpp b/src/core/src/op/util/slice_plan.cpp index 7a1265dd273..b93370c9220 100644 --- a/src/core/src/op/util/slice_plan.cpp +++ b/src/core/src/op/util/slice_plan.cpp @@ -9,6 +9,7 @@ #include "ngraph/check.hpp" using namespace ngraph; +NGRAPH_SUPPRESS_DEPRECATED_START SlicePlan ngraph::make_slice_plan(const Shape& input_shape, const std::vector& begins, diff --git a/src/core/src/op/variadic_split.cpp b/src/core/src/op/variadic_split.cpp index 91c9069e6ec..d09ab3c4047 100644 --- a/src/core/src/op/variadic_split.cpp +++ b/src/core/src/op/variadic_split.cpp @@ -86,8 +86,8 @@ bool op::v1::VariadicSplit::evaluate_variadic_split(const HostTensorVector& inpu NGRAPH_CHECK(split_lengths_tensor->get_element_type().is_integral_number(), "split_lengths element type is not integral data type"); - int64_t axis = host_tensor_2_vector(axis_tensor)[0]; OPENVINO_SUPPRESS_DEPRECATED_START + int64_t axis = host_tensor_2_vector(axis_tensor)[0]; axis = ngraph::normalize_axis(this, axis, data_tensor->get_partial_shape().rank()); OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/src/opsets/opset.cpp b/src/core/src/opsets/opset.cpp index d2282773405..7c9e734ea56 100644 --- a/src/core/src/opsets/opset.cpp +++ b/src/core/src/opsets/opset.cpp @@ -5,10 +5,13 @@ #include "ngraph/opsets/opset.hpp" #include "itt.hpp" +#include "ngraph/deprecated.hpp" #include "ngraph/log.hpp" #include "ngraph/ops.hpp" #include "openvino/opsets/opset.hpp" +#include "openvino/util/log.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START ngraph::OpSet::OpSet(const ov::OpSet& opset) : ov::OpSet(opset) {} ngraph::OpSet::OpSet(const ngraph::OpSet& opset) : ov::OpSet(opset) {} @@ -31,7 +34,7 @@ ov::OpSet& ov::OpSet::operator=(const ov::OpSet& opset) { ov::Node* ov::OpSet::create(const std::string& name) const { auto type_info_it = m_name_type_info_map.find(name); if (type_info_it == m_name_type_info_map.end()) { - NGRAPH_WARN << "Couldn't create operator of type: " << name << " . Operation not registered in opset."; + OPENVINO_WARN << "Couldn't create operator of type: " << name << " . Operation not registered in opset."; return nullptr; } REGISTER_OP(m_name, name); @@ -41,7 +44,7 @@ ov::Node* ov::OpSet::create(const std::string& name) const { ov::Node* ov::OpSet::create_insensitive(const std::string& name) const { auto type_info_it = m_case_insensitive_type_info_map.find(to_upper_name(name)); if (type_info_it == m_case_insensitive_type_info_map.end()) { - NGRAPH_WARN << "Couldn't create operator of type: " << name << " . Operation not registered in opset."; + OPENVINO_WARN << "Couldn't create operator of type: " << name << " . Operation not registered in opset."; return nullptr; } REGISTER_OP(m_name, name); diff --git a/src/core/src/partial_shape.cpp b/src/core/src/partial_shape.cpp index 22e583bedd9..c7eb28bf429 100644 --- a/src/core/src/partial_shape.cpp +++ b/src/core/src/partial_shape.cpp @@ -26,6 +26,7 @@ ov::PartialShape::PartialShape(const Shape& shape) m_dimensions(shape.begin(), shape.end()) {} ov::PartialShape::PartialShape(const std::string& value) { + OPENVINO_SUPPRESS_DEPRECATED_START auto val = ngraph::trim(value); if (val[0] == '[' && val[val.size() - 1] == ']') val = val.substr(1, val.size() - 2); @@ -44,6 +45,7 @@ ov::PartialShape::PartialShape(const std::string& value) { dims.insert(dims.end(), Dimension(field)); } m_dimensions = dims; + OPENVINO_SUPPRESS_DEPRECATED_END } ov::PartialShape::PartialShape(bool rank_is_static, std::vector dimensions) diff --git a/src/core/src/pass/graph_rewrite.cpp b/src/core/src/pass/graph_rewrite.cpp index c51b5159267..df20ff8a7cd 100644 --- a/src/core/src/pass/graph_rewrite.cpp +++ b/src/core/src/pass/graph_rewrite.cpp @@ -17,6 +17,7 @@ #include "ngraph/env_util.hpp" #include "ngraph/log.hpp" #include "ngraph/op/util/sub_graph_base.hpp" +#include "openvino/util/log.hpp" #include "perf_counters.hpp" /* GraphRewrite algorithm: @@ -142,10 +143,10 @@ bool ov::pass::GraphRewrite::apply_matcher_passes(std::shared_ptr f, // Keep this property check for backward compatibility. In future transformation property // will be deprecated and removed. if (m_pass->get_property(PassProperty::REQUIRE_STATIC_SHAPE) && f->is_dynamic()) { - NGRAPH_DEBUG << "matcher callback requires static shape but the " - "model is dynamic, skipping this " - "optimization till the shapes are fully " - "materialized"; + OPENVINO_DEBUG << "matcher callback requires static shape but the " + "model is dynamic, skipping this " + "optimization till the shapes are fully " + "materialized"; return false; } @@ -274,10 +275,10 @@ void ov::pass::MatcherPass::register_matcher(const std::shared_ptr& node) -> bool { if (m->match(node->output(0))) { - NGRAPH_DEBUG << "Matcher " << m->get_name() << " matched " << node; + OPENVINO_DEBUG << "Matcher " << m->get_name() << " matched " << node; OV_PASS_CALLBACK(m); const bool status = callback(*m.get()); - NGRAPH_DEBUG << "Matcher " << m->get_name() << " callback " << (status ? "succeded" : "failed"); + OPENVINO_DEBUG << "Matcher " << m->get_name() << " callback " << (status ? "succeded" : "failed"); // explicitly clear Matcher state because it holds pointers to matched nodes m->clear_state(); return status; diff --git a/src/core/src/pass/low_latency.cpp b/src/core/src/pass/low_latency.cpp index 5364b08fd8a..0b8d6f2e8c2 100644 --- a/src/core/src/pass/low_latency.cpp +++ b/src/core/src/pass/low_latency.cpp @@ -348,7 +348,7 @@ bool ov::pass::LowLatency2::run_on_model(const shared_ptr& f) { const auto& input = sub_graph_op->input(merged_in->m_input_index); if (dynamic_pointer_cast(input.get_source_output().get_node_shared_ptr()) != nullptr) { - NGRAPH_DEBUG << msg_low_latency_2_already_applied; + OPENVINO_DEBUG << msg_low_latency_2_already_applied; return false; } @@ -356,7 +356,7 @@ bool ov::pass::LowLatency2::run_on_model(const shared_ptr& f) { sub_graph_op->get_function()->get_parameters().at(merged_in->m_body_parameter_index); for (const auto& in_to : param->output(0).get_target_inputs()) { if (dynamic_cast(in_to.get_node()) != nullptr) { - NGRAPH_DEBUG << msg_low_latency_already_applied; + OPENVINO_DEBUG << msg_low_latency_already_applied; return false; } } diff --git a/src/core/src/pass/manager.cpp b/src/core/src/pass/manager.cpp index fa01e69b9f2..1d9b0c0e129 100644 --- a/src/core/src/pass/manager.cpp +++ b/src/core/src/pass/manager.cpp @@ -21,6 +21,7 @@ #include "ngraph/pass/visualize_tree.hpp" #include "ngraph/util.hpp" #include "openvino/util/env_util.hpp" +#include "openvino/util/log.hpp" #include "perf_counters.hpp" using namespace std; @@ -75,7 +76,7 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { bool needs_validate = false; for (auto& pass : m_pass_list) { if (m_pass_config->is_disabled(pass->get_type_info())) { - NGRAPH_DEBUG << "Pass " << pass->get_name() << " is disabled"; + OPENVINO_DEBUG << "Pass " << pass->get_name() << " is disabled"; continue; } @@ -87,8 +88,8 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { // This checks is to skip the graph transformation when the graph pass relies on // static shape but the function state is dynamic. if (matcher_pass->get_property(PassProperty::REQUIRE_STATIC_SHAPE) && func->is_dynamic()) { - NGRAPH_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " - << "model is dynamic. Skipping this transformation"; + OPENVINO_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " + << "model is dynamic. Skipping this transformation"; continue; } // GraphRewrite is a temporary container for MatcherPass to make execution @@ -98,8 +99,8 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { // This checks is to skip the graph transformation when the graph pass relies on // static shape but the function state is dynamic. if (function_pass->get_property(PassProperty::REQUIRE_STATIC_SHAPE) && func->is_dynamic()) { - NGRAPH_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " - << "model is dynamic. Skipping this transformation"; + OPENVINO_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " + << "model is dynamic. Skipping this transformation"; continue; } @@ -113,8 +114,8 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { } } else if (auto node_pass = dynamic_pointer_cast(pass)) { if (node_pass->get_property(PassProperty::REQUIRE_STATIC_SHAPE) && func->is_dynamic()) { - NGRAPH_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " - << "model is dynamic. Skipping this transformation"; + OPENVINO_DEBUG << "Pass " << pass->get_name() << " requires static shape but the " + << "model is dynamic. Skipping this transformation"; continue; } for (const shared_ptr& n : func->get_ops()) { diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index dc7f634488b..37e1b2e859c 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -26,6 +26,7 @@ #include "transformations/hash.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" +OPENVINO_SUPPRESS_DEPRECATED_START namespace { // helpers template std::string join(const Container& c, const char* glue = ", ") { diff --git a/src/core/src/pass/visualize_tree.cpp b/src/core/src/pass/visualize_tree.cpp index c89decb3f42..ca90629b7bd 100644 --- a/src/core/src/pass/visualize_tree.cpp +++ b/src/core/src/pass/visualize_tree.cpp @@ -138,6 +138,7 @@ static std::string label_edge(const std::shared_ptr& /* src */, size_t arg_index, int64_t jump_distance) { std::stringstream ss; + OPENVINO_SUPPRESS_DEPRECATED_START if (getenv_bool("OV_VISUALIZE_TREE_EDGE_LABELS")) { size_t output = 0; stringstream label_edge; @@ -150,6 +151,7 @@ static std::string label_edge(const std::shared_ptr& /* src */, ss << label_edge.str(); } } + OPENVINO_SUPPRESS_DEPRECATED_END return ss.str(); } @@ -224,7 +226,9 @@ pass::VisualizeTree::VisualizeTree(const string& file_name, node_modifiers_t nm, void pass::VisualizeTree::add_node_arguments(shared_ptr node, unordered_map& height_maps, size_t& fake_node_ctr) { + OPENVINO_SUPPRESS_DEPRECATED_START static const int const_max_elements = getenv_int("OV_VISUALIZE_TREE_CONST_MAX_ELEMENTS", 7); + OPENVINO_SUPPRESS_DEPRECATED_END size_t arg_index = 0; for (auto input_value : node->input_values()) { @@ -369,11 +373,13 @@ static std::string pretty_value(const vector& values, size_t max_elements) { ss << value; } + OPENVINO_SUPPRESS_DEPRECATED_START const std::string additional_ss = getenv_bool("OV_VISUALIZE_TREE_MIN_MAX_DENORMAL") ? pretty_min_max_denormal_value(values) : ""; if (!additional_ss.empty()) { ss << std::endl << "(" << additional_ss << ")"; } + OPENVINO_SUPPRESS_DEPRECATED_END return ss.str(); } @@ -442,12 +448,14 @@ string pass::VisualizeTree::get_attributes(shared_ptr node) { stringstream label; label << "label=\"" << get_node_name(node); + OPENVINO_SUPPRESS_DEPRECATED_START static const bool nvtos = getenv_bool("NGRAPH_VISUALIZE_TREE_OUTPUT_SHAPES") || getenv_bool("OV_VISUALIZE_TREE_OUTPUT_SHAPES"); static const bool nvtot = getenv_bool("NGRAPH_VISUALIZE_TREE_OUTPUT_TYPES") || getenv_bool("OV_VISUALIZE_TREE_OUTPUT_TYPES"); static const bool nvtio = getenv_bool("OV_VISUALIZE_TREE_IO"); static const bool nvtrti = getenv_bool("OV_VISUALIZE_TREE_RUNTIME_INFO"); + OPENVINO_SUPPRESS_DEPRECATED_END if (nvtos || nvtot || nvtio) { if (nvtio) { @@ -492,12 +500,15 @@ string pass::VisualizeTree::get_attributes(shared_ptr node) { } stringstream ss; + OPENVINO_SUPPRESS_DEPRECATED_START ss << " " << node->get_name() << " [" << join(attributes, " ") << "]\n"; + OPENVINO_SUPPRESS_DEPRECATED_END return ss.str(); } string pass::VisualizeTree::get_node_name(shared_ptr node) { + OPENVINO_SUPPRESS_DEPRECATED_START static const bool nvtmn = getenv_bool("OV_VISUALIZE_TREE_MEMBERS_NAME"); string rc = (nvtmn ? string("friendly_name: ") : "") + node->get_friendly_name(); if (node->get_friendly_name() != node->get_name()) { @@ -552,6 +563,7 @@ string pass::VisualizeTree::get_node_name(shared_ptr node) { rc += "\\nrt info: " + get_attribute_values(rt, "\\n"); } } + OPENVINO_SUPPRESS_DEPRECATED_END return rc; } diff --git a/src/core/src/pattern/matcher.cpp b/src/core/src/pattern/matcher.cpp index 483452da8c7..864b9a025ae 100644 --- a/src/core/src/pattern/matcher.cpp +++ b/src/core/src/pattern/matcher.cpp @@ -12,6 +12,7 @@ #include "ngraph/op/parameter.hpp" #include "ngraph/op/util/op_types.hpp" #include "openvino/util/env_util.hpp" +#include "openvino/util/log.hpp" namespace ov { namespace pass { @@ -119,13 +120,14 @@ bool Matcher::match_permutation(const OutputVector& pattern_args, const OutputVe } bool Matcher::match_arguments(Node* pattern_node, const std::shared_ptr& graph_node) { - NGRAPH_DEBUG << "[MATCHER] Match arguments at " << *graph_node << " for pattern " << *pattern_node; + OPENVINO_SUPPRESS_DEPRECATED_START + OPENVINO_DEBUG << "[MATCHER] Match arguments at " << *graph_node << " for pattern " << *pattern_node; auto args = graph_node->input_values(); auto pattern_args = pattern_node->input_values(); if (args.size() != pattern_args.size()) { - NGRAPH_DEBUG << "[MATCHER] Aborting at " << *graph_node << " for pattern " << *pattern_node; + OPENVINO_DEBUG << "[MATCHER] Aborting at " << *graph_node << " for pattern " << *pattern_node; return false; } @@ -152,7 +154,8 @@ bool Matcher::match_arguments(Node* pattern_node, const std::shared_ptr& g return match_permutation(pattern_args, args); } - NGRAPH_DEBUG << "[MATCHER] Aborting at " << *graph_node << " for pattern " << *pattern_node; + OPENVINO_DEBUG << "[MATCHER] Aborting at " << *graph_node << " for pattern " << *pattern_node; + OPENVINO_SUPPRESS_DEPRECATED_END return false; } diff --git a/src/core/src/shape.cpp b/src/core/src/shape.cpp index 9803f8a3cc1..c2daeb7edab 100644 --- a/src/core/src/shape.cpp +++ b/src/core/src/shape.cpp @@ -10,7 +10,9 @@ using namespace std; std::ostream& ov::operator<<(std::ostream& s, const Shape& shape) { s << "["; + OPENVINO_SUPPRESS_DEPRECATED_START s << ngraph::join(shape, ","); + OPENVINO_SUPPRESS_DEPRECATED_END s << "]"; return s; } @@ -37,10 +39,12 @@ ov::Shape::Shape(const Shape& axis_lengths) = default; ov::Shape::Shape(size_t n, size_t initial_value) : std::vector(n, initial_value) {} ov::Shape::Shape(const std::string& value) { + OPENVINO_SUPPRESS_DEPRECATED_START auto val = ngraph::trim(value); if (val[0] == '[' && val[val.size() - 1] == ']') val = val.substr(1, val.size() - 2); val = ngraph::trim(val); + OPENVINO_SUPPRESS_DEPRECATED_END std::vector dims; std::stringstream ss(val); std::string field; diff --git a/src/core/src/strides.cpp b/src/core/src/strides.cpp index 4cf15adc4f8..cdf1f7e210c 100644 --- a/src/core/src/strides.cpp +++ b/src/core/src/strides.cpp @@ -8,7 +8,9 @@ std::ostream& ov::operator<<(std::ostream& s, const ov::Strides& strides) { s << "Strides{"; + OPENVINO_SUPPRESS_DEPRECATED_START s << ngraph::join(strides); + OPENVINO_SUPPRESS_DEPRECATED_END s << "}"; return s; } diff --git a/src/core/src/util.cpp b/src/core/src/util.cpp index 8a5f6ea6502..66fb1913ae1 100644 --- a/src/core/src/util.cpp +++ b/src/core/src/util.cpp @@ -22,6 +22,7 @@ #include "ngraph/partial_shape.hpp" #include "ngraph/shape.hpp" #include "openvino/util/common_util.hpp" +#include "openvino/util/log.hpp" NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; @@ -84,7 +85,7 @@ size_t ngraph::hash_combine(const std::vector& list) { void* ngraph::ngraph_malloc(size_t size) { auto ptr = malloc(size); if (size != 0 && !ptr) { - NGRAPH_ERR << "malloc failed to allocate memory of size " << size; + OPENVINO_ERR << "malloc failed to allocate memory of size " << size; throw std::bad_alloc(); } return ptr; diff --git a/src/core/tests/bfloat16.cpp b/src/core/tests/bfloat16.cpp index 180ae3b41aa..bcee6dc511b 100644 --- a/src/core/tests/bfloat16.cpp +++ b/src/core/tests/bfloat16.cpp @@ -10,6 +10,7 @@ #include "gtest/gtest.h" #include "ngraph/log.hpp" #include "ngraph/runtime/aligned_buffer.hpp" +#include "openvino/util/log.hpp" #include "util/float_util.hpp" using namespace std; @@ -149,7 +150,7 @@ TEST(benchmark, bfloat16) { for (size_t i = 0; i < buffer_size; ++i) { f[i] = distribution(rng); } - NGRAPH_INFO << "buffer size " << buffer_size << " floats or " << data.size() << " bytes"; + OPENVINO_INFO << "buffer size " << buffer_size << " floats or " << data.size() << " bytes"; { ngraph::runtime::AlignedBuffer bf_data(buffer_size * sizeof(bfloat16), 4096); @@ -160,7 +161,7 @@ TEST(benchmark, bfloat16) { p[i] = bfloat16(f[i]); } timer.stop(); - NGRAPH_INFO << "float to bfloat16 ctor " << timer.get_milliseconds() << "ms"; + OPENVINO_INFO << "float to bfloat16 ctor " << timer.get_milliseconds() << "ms"; } { @@ -172,7 +173,7 @@ TEST(benchmark, bfloat16) { p[i] = bfloat16::truncate(f[i]); } timer.stop(); - NGRAPH_INFO << "float to bfloat16 truncate " << timer.get_milliseconds() << "ms"; + OPENVINO_INFO << "float to bfloat16 truncate " << timer.get_milliseconds() << "ms"; } { @@ -184,7 +185,7 @@ TEST(benchmark, bfloat16) { p[i] = bfloat16::round_to_nearest(f[i]); } timer.stop(); - NGRAPH_INFO << "float to bfloat16 round to nearest " << timer.get_milliseconds() << "ms"; + OPENVINO_INFO << "float to bfloat16 round to nearest " << timer.get_milliseconds() << "ms"; } { @@ -196,7 +197,7 @@ TEST(benchmark, bfloat16) { p[i] = bfloat16::round_to_nearest_even(f[i]); } timer.stop(); - NGRAPH_INFO << "float to bfloat16 round to nearest even " << timer.get_milliseconds() << "ms"; + OPENVINO_INFO << "float to bfloat16 round to nearest even " << timer.get_milliseconds() << "ms"; } NGRAPH_SUPPRESS_DEPRECATED_END } diff --git a/src/core/tests/constant.cpp b/src/core/tests/constant.cpp index 391b046b7bc..7661d5929ad 100644 --- a/src/core/tests/constant.cpp +++ b/src/core/tests/constant.cpp @@ -1352,7 +1352,7 @@ template ::testing::AssertionResult test_convert() { Shape shape{5}; vector expected{1, 2, 3, 4, 5}; - auto c1 = make_shared(element::from(), shape, expected); + auto c1 = make_shared(ov::element::from(), shape, expected); vector actual = c1->template cast_vector(); ::testing::AssertionResult rc = (actual == expected ? ::testing::AssertionSuccess() : ::testing::AssertionFailure()); @@ -1522,7 +1522,7 @@ template ::testing::AssertionResult test_uniform_ctor() { Shape shape{5}; vector expected{3, 3, 3, 3, 3}; - auto c1 = make_shared(element::from(), shape, 3); + auto c1 = make_shared(ov::element::from(), shape, 3); vector actual = c1->template cast_vector(); ::testing::AssertionResult rc = (actual == expected ? ::testing::AssertionSuccess() : ::testing::AssertionFailure()); diff --git a/src/core/tests/constant_folding.cpp b/src/core/tests/constant_folding.cpp index a5bf60f615b..e2b4b71dd24 100644 --- a/src/core/tests/constant_folding.cpp +++ b/src/core/tests/constant_folding.cpp @@ -2663,11 +2663,11 @@ void range_test(T start, T stop, T step, const vector& values_expected) { vector values_stop{stop}; vector values_step{step}; - auto constant_start = make_shared(element::from(), Shape{}, values_start); + auto constant_start = make_shared(ov::element::from(), Shape{}, values_start); constant_start->set_friendly_name("constant_start"); - auto constant_stop = make_shared(element::from(), Shape{}, values_stop); + auto constant_stop = make_shared(ov::element::from(), Shape{}, values_stop); constant_stop->set_friendly_name("constant_stop"); - auto constant_step = make_shared(element::from(), Shape{}, values_step); + auto constant_step = make_shared(ov::element::from(), Shape{}, values_step); constant_step->set_friendly_name("constant_step"); auto range = make_shared(constant_start, constant_stop, constant_step); range->set_friendly_name("test"); diff --git a/src/core/tests/control_dependencies.cpp b/src/core/tests/control_dependencies.cpp index 2ccb6d0d3e8..158cf98a5a8 100644 --- a/src/core/tests/control_dependencies.cpp +++ b/src/core/tests/control_dependencies.cpp @@ -94,7 +94,7 @@ TEST(control_dependencies, clone_function_cdop) { auto f = make_shared(cdop, ParameterVector{A}); test_ordered_ops(f, NodeVector{absn}); - auto clone = ngraph::clone_function(*f.get()); + auto clone = f->clone(); auto matcher = std::make_shared(cdop); auto cdop_clone = clone->get_results().at(0)->input_value(0).get_node_shared_ptr(); ASSERT_TRUE(matcher->match(cdop_clone)); @@ -113,7 +113,7 @@ TEST(control_dependencies, clone_function_cdop_abs) { auto absn_cdop = make_shared(cdop); auto f = make_shared(absn_cdop, ParameterVector{A, B}); - auto clone = ngraph::clone_function(*f.get()); + auto clone = f->clone(); auto matcher = std::make_shared(cdop); auto cdop_clone = clone->get_results().at(0)->input_value(0).get_node_shared_ptr()->input_value(0).get_node_shared_ptr(); diff --git a/src/core/tests/element_type.cpp b/src/core/tests/element_type.cpp index c19d17ea301..5db6d0b9156 100644 --- a/src/core/tests/element_type.cpp +++ b/src/core/tests/element_type.cpp @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "openvino/core/except.hpp" -using namespace ngraph; +using namespace ov; TEST(element_type, from) { EXPECT_EQ(element::from(), element::boolean); diff --git a/src/core/tests/partial_shape.cpp b/src/core/tests/partial_shape.cpp index 3b6ae3f829a..712265944fc 100644 --- a/src/core/tests/partial_shape.cpp +++ b/src/core/tests/partial_shape.cpp @@ -685,6 +685,7 @@ TEST(partial_shape, partial_shape_relaxes_refines_static_static_not_eq) { ASSERT_FALSE(s2.relaxes(s1)); } +OPENVINO_SUPPRESS_DEPRECATED_START TEST(partial_shape, partial_shape_project_rank_dynamic) { PartialShape s1{PartialShape::dynamic()}; PartialShape s2 = project(s1, AxisSet{284, 0, 103}); diff --git a/src/core/tests/pattern.cpp b/src/core/tests/pattern.cpp index ef5a75ec99c..8f2ad179a72 100644 --- a/src/core/tests/pattern.cpp +++ b/src/core/tests/pattern.cpp @@ -31,6 +31,7 @@ #include "ngraph/pattern/op/or.hpp" #include "ngraph/pattern/op/skip.hpp" #include "ngraph/pattern/op/true.hpp" +#include "openvino/util/log.hpp" #include "util/matcher.hpp" #include "util/test_tools.hpp" @@ -78,7 +79,7 @@ public: auto pattern = std::make_shared(iconst1); auto callback = [pattern](pattern::Matcher& m) { - NGRAPH_DEBUG << "In a callback for construct_multiply_by_one against " << m.get_match_root()->get_name(); + OPENVINO_DEBUG << "In a callback for construct_multiply_by_one against " << m.get_match_root()->get_name(); NGRAPH_CHECK(m.get_match_root()->input_values().size() == 2); auto pattern_map = m.get_pattern_map(); @@ -87,12 +88,12 @@ public: auto const_node = ov::as_type_ptr(m.get_match_root()->input_value(const_node_index).get_node_shared_ptr()); auto second_node = m.get_match_root()->input_value(const_node_index).get_node_shared_ptr(); - NGRAPH_DEBUG << "second_node = " << second_node->get_name() - << " , pattern = " << pattern_map[pattern]->get_name(); + OPENVINO_DEBUG << "second_node = " << second_node->get_name() + << " , pattern = " << pattern_map[pattern]->get_name(); if (pattern_map[pattern]->get_element_type() != const_node->get_element_type() || pattern_map[pattern]->get_shape() != const_node->get_shape()) { - NGRAPH_DEBUG << "Operands' types and/or shape don't match"; + OPENVINO_DEBUG << "Operands' types and/or shape don't match"; return false; } @@ -102,7 +103,7 @@ public: }); if (!all_ones) { - NGRAPH_DEBUG << "Constant vector's values aren't equal to 1"; + OPENVINO_DEBUG << "Constant vector's values aren't equal to 1"; return false; } @@ -115,9 +116,9 @@ public: m->get_name(), m, [m, callback](const std::shared_ptr& node) -> bool { - NGRAPH_DEBUG << "Running matcher " << m->get_name() << " on " << node; + OPENVINO_DEBUG << "Running matcher " << m->get_name() << " on " << node; if (std::dynamic_pointer_cast(m)->match(node->output(0))) { - NGRAPH_DEBUG << "Matcher " << m->get_name() << " matched " << node; + OPENVINO_DEBUG << "Matcher " << m->get_name() << " matched " << node; bool status = callback(*m.get()); // explicitly clear Matcher state because it holds pointers to matched nodes m->clear_state(); @@ -136,7 +137,7 @@ public: auto pattern = std::make_shared(iconst0); auto callback = [pattern](pattern::Matcher& m) { - NGRAPH_DEBUG << "In a callback for construct_add_zero against " << m.get_match_root()->get_name(); + OPENVINO_DEBUG << "In a callback for construct_add_zero against " << m.get_match_root()->get_name(); NGRAPH_CHECK(m.get_match_root()->input_values().size() == 2); auto pattern_map = m.get_pattern_map(); @@ -145,12 +146,12 @@ public: auto const_node = ov::as_type_ptr(m.get_match_root()->input_value(const_node_index).get_node_shared_ptr()); auto second_node = m.get_match_root()->input_value(const_node_index).get_node_shared_ptr(); - NGRAPH_DEBUG << "second_node = " << second_node->get_name() - << " , pattern = " << pattern_map[pattern]->get_name(); + OPENVINO_DEBUG << "second_node = " << second_node->get_name() + << " , pattern = " << pattern_map[pattern]->get_name(); if (pattern_map[pattern]->get_element_type() != const_node->get_element_type() || pattern_map[pattern]->get_shape() != const_node->get_shape()) { - NGRAPH_DEBUG << "Operands' types and/or shape don't match"; + OPENVINO_DEBUG << "Operands' types and/or shape don't match"; return false; } @@ -160,7 +161,7 @@ public: }); if (!all_zeros) { - NGRAPH_DEBUG << "Constant vector's values aren't equal to 0"; + OPENVINO_DEBUG << "Constant vector's values aren't equal to 0"; return false; } @@ -174,9 +175,9 @@ public: m->get_name(), m, [m, callback](const std::shared_ptr& node) -> bool { - NGRAPH_DEBUG << "Running matcher " << m->get_name() << " on " << node; + OPENVINO_DEBUG << "Running matcher " << m->get_name() << " on " << node; if (std::dynamic_pointer_cast(m)->match(node->output(0))) { - NGRAPH_DEBUG << "Matcher " << m->get_name() << " matched " << node; + OPENVINO_DEBUG << "Matcher " << m->get_name() << " matched " << node; bool status = callback(*m.get()); // explicitly clear Matcher state because it holds pointers to matched nodes m->clear_state(); @@ -640,13 +641,13 @@ public: auto padd = make_shared(iconst_label, rpattern); auto callback = [iconst_label, rpattern](pattern::RecurrentMatcher& rm) { - NGRAPH_DEBUG << "In a callback for construct_recurrent_add against " << rm.get_match_root()->get_name(); + OPENVINO_DEBUG << "In a callback for construct_recurrent_add against " << rm.get_match_root()->get_name(); auto iconst_matches = rm.get_bound_nodes_for_pattern(iconst_label); auto is_iconst_zero = [](std::shared_ptr n) { bool result = ngraph::is_zero(n); - NGRAPH_DEBUG << n->get_name() << " is " << (result ? " a zero " : " not a zero"); + OPENVINO_DEBUG << n->get_name() << " is " << (result ? " a zero " : " not a zero"); return ngraph::is_zero(n); }; @@ -660,7 +661,7 @@ public: // replace the topmost add with the seed (i.e. the first parameter to add) // matches are added in reverse order (i.e. the first match is the topmost node) auto arg = rm.get_bound_nodes_for_pattern(rpattern).at(number_of_adds - 1); - NGRAPH_DEBUG << "Replacing " << rm.get_match_root()->get_name() << " with " << arg->get_name(); + OPENVINO_DEBUG << "Replacing " << rm.get_match_root()->get_name() << " with " << arg->get_name(); ngraph::replace_node(rm.get_match_root(), arg); return true; }; diff --git a/src/core/tests/type_prop/batch_to_space.cpp b/src/core/tests/type_prop/batch_to_space.cpp index f35afb75fc9..3f65a115b2e 100644 --- a/src/core/tests/type_prop/batch_to_space.cpp +++ b/src/core/tests/type_prop/batch_to_space.cpp @@ -353,6 +353,7 @@ TEST(type_prop, batch_to_space_output_dynamic_shape_5D_when_batch_is_static) { {100, 150}, {10 * 16, 20 * 16}})); } +OPENVINO_SUPPRESS_DEPRECATED_START TEST(type_prop, batch_to_space_output_dynamic_shape_5D_when_batch_is_dynamic) { auto data_shape = PartialShape{{959, 962}, {2, 34}, {9, 21}, {100, 162}, {1, 1999}}; diff --git a/src/core/tests/type_prop/depth_to_space.cpp b/src/core/tests/type_prop/depth_to_space.cpp index 935730a78b9..71004349ef0 100644 --- a/src/core/tests/type_prop/depth_to_space.cpp +++ b/src/core/tests/type_prop/depth_to_space.cpp @@ -34,6 +34,8 @@ TEST(type_prop, depth_to_space_input_interval_shape_default_block_size) { EXPECT_THAT(get_shape_labels(depth_to_space->get_output_partial_shape(0)), ElementsAre(10, 11, 12, 13, 14)); } +OPENVINO_SUPPRESS_DEPRECATED_START + TEST(type_prop, depth_to_space_output_dynamicshape_block_first_5D_when_depth_is_dynamic) { auto A = make_shared(element::f32, PartialShape{{2, 10}, {81, 82}, {3, 7}, {423, 3000}, {235, 1345}}); diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index 5ce1350e541..35c02e765b5 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -20,6 +20,7 @@ #include "onnx_import/core/null_node.hpp" #include "openvino/frontend/onnx/extension/conversion.hpp" #include "openvino/frontend/onnx/node_context.hpp" +#include "openvino/util/log.hpp" #include "ops_bridge.hpp" #include "utils/common.hpp" #include "utils/legacy_conversion_extension.hpp" @@ -380,7 +381,7 @@ OutputVector Graph::make_ng_nodes(const Node& onnx_node) { std::string msg_prefix = error::detail::get_error_msg_prefix(onnx_node); // Since we do not know anything about current exception data type we can only // notify user in this way. - NGRAPH_ERR << msg_prefix + "Unhandled exception type. \n"; + OPENVINO_ERR << msg_prefix + "Unhandled exception type. \n"; std::rethrow_exception(std::current_exception()); } diff --git a/src/frontends/onnx/frontend/src/core/model.cpp b/src/frontends/onnx/frontend/src/core/model.cpp index 74bc514aaae..f10ff4839d5 100644 --- a/src/frontends/onnx/frontend/src/core/model.cpp +++ b/src/frontends/onnx/frontend/src/core/model.cpp @@ -8,6 +8,7 @@ #include "ngraph/log.hpp" #include "onnx_framework_node.hpp" +#include "openvino/util/log.hpp" #include "ops_bridge.hpp" namespace ngraph { @@ -68,7 +69,8 @@ void Model::enable_opset_domain(const std::string& domain, const OperatorsBridge if (m_opset.find(domain) == std::end(m_opset)) { const auto opset = ops_bridge.get_operator_set(domain); if (opset.empty()) { - NGRAPH_WARN << "Couldn't enable domain: " << domain << " since it does not have any registered operators."; + OPENVINO_WARN << "Couldn't enable domain: " << domain + << " since it does not have any registered operators."; return; } m_opset.emplace(domain, opset); diff --git a/src/frontends/onnx/frontend/src/core/node.cpp b/src/frontends/onnx/frontend/src/core/node.cpp index 35adc13939f..29857e6efd9 100644 --- a/src/frontends/onnx/frontend/src/core/node.cpp +++ b/src/frontends/onnx/frontend/src/core/node.cpp @@ -226,7 +226,7 @@ const std::string& Node::Impl::description() const { template std::shared_ptr Node::Impl::get_attribute_as_constant(const std::string& name) const { const auto value = get_attribute_value(name); - const element::Type type = element::from(); + const element::Type type = ov::element::from(); return std::make_shared(type, Shape{}, value); } @@ -234,7 +234,7 @@ template std::shared_ptr Node::Impl::get_attribute_as_constant(const std::string& name, T default_value) const { const auto value = get_attribute_value(name, default_value); - const element::Type type = element::from(); + const element::Type type = ov::element::from(); return std::make_shared(type, Shape{}, value); } @@ -243,7 +243,7 @@ std::shared_ptr Node::Impl::get_attribute_as_constant(cons T default_value, element::Type type) const { const auto value = get_attribute_value(name, default_value); - return std::make_shared(type == element::undefined ? element::from() : type, + return std::make_shared(type == element::undefined ? ov::element::from() : type, Shape{}, value); } @@ -252,7 +252,7 @@ template std::shared_ptr Node::Impl::get_attribute_as_constant(const std::string& name, element::Type type) const { const auto value = get_attribute_value(name); - return std::make_shared(type == element::undefined ? element::from() : type, + return std::make_shared(type == element::undefined ? ov::element::from() : type, Shape{}, value); } diff --git a/src/frontends/onnx/frontend/src/core/transform.cpp b/src/frontends/onnx/frontend/src/core/transform.cpp index 32cca2fb0b9..2be07edb041 100644 --- a/src/frontends/onnx/frontend/src/core/transform.cpp +++ b/src/frontends/onnx/frontend/src/core/transform.cpp @@ -2,14 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/util/log.hpp" #if defined(_MSC_VER) # pragma warning(push) // Protobuf: conversion from 'XXX' to 'YYY', possible loss of data # pragma warning(disable : 4244) #endif -#include "core/transform.hpp" - #include #include #include @@ -17,6 +16,7 @@ #include #include "core/model.hpp" +#include "core/transform.hpp" #include "ngraph/log.hpp" #include "ops_bridge.hpp" @@ -110,7 +110,7 @@ void ngraph::onnx_import::transform::expand_onnx_functions(ONNX_NAMESPACE::Model try { ONNX_NAMESPACE::shape_inference::InferShapes(model_proto); } catch (const std::exception& e) { - NGRAPH_WARN << "ONNX Shape inference failed: " << e.what(); + OPENVINO_WARN << "ONNX Shape inference failed: " << e.what(); } std::vector input_types; diff --git a/src/frontends/onnx/frontend/src/editor.cpp b/src/frontends/onnx/frontend/src/editor.cpp index c597cad48e6..d9054b5a319 100644 --- a/src/frontends/onnx/frontend/src/editor.cpp +++ b/src/frontends/onnx/frontend/src/editor.cpp @@ -12,10 +12,10 @@ #include "detail/subgraph_extraction.hpp" #include "edge_mapper.hpp" #include "ngraph/file_util.hpp" -#include "ngraph/log.hpp" #include "onnx_common/parser.hpp" #include "onnx_common/utils.hpp" #include "openvino/util/file_util.hpp" +#include "openvino/util/log.hpp" #include "utils/common.hpp" #include "utils/onnx_internal.hpp" @@ -412,7 +412,7 @@ PartialShape onnx_editor::ONNXModelEditor::get_tensor_shape(const std::string& t } else { auto shape_infer_applied = onnx_shapes.infer_shapes(); if (!shape_infer_applied) { - NGRAPH_WARN << "Cannot replace existing shapes during get_tensor_shape"; + OPENVINO_WARN << "Cannot replace existing shapes during get_tensor_shape"; return PartialShape::dynamic(); } auto node_it = std::find_if(std::begin(onnx_graph->value_info()), @@ -537,8 +537,8 @@ void onnx_editor::ONNXModelEditor::set_input_values( auto onnx_initializer = find_graph_initializer(*onnx_graph, name); if (!onnx_initializer && !onnx_input) { - NGRAPH_INFO << "There is no input nor initializer named '" << name << "' in original model '" - << m_model_path << "'."; + OPENVINO_INFO << "There is no input nor initializer named '" << name << "' in original model '" + << m_model_path << "'."; } if (!onnx_initializer) { diff --git a/src/frontends/onnx/frontend/src/input_model.cpp b/src/frontends/onnx/frontend/src/input_model.cpp index 8d1fb4ee699..41706c0dc20 100644 --- a/src/frontends/onnx/frontend/src/input_model.cpp +++ b/src/frontends/onnx/frontend/src/input_model.cpp @@ -8,6 +8,7 @@ #include #include "ngraph/log.hpp" +#include "openvino/util/log.hpp" #include "place.hpp" using namespace ov; @@ -257,8 +258,8 @@ void InputModel::override_all_outputs(const std::vectorget_names().at(0) - << " of output node is not a correct node name. Ignoring this parameter."; + OPENVINO_WARN << "Name " << output->get_names().at(0) + << " of output node is not a correct node name. Ignoring this parameter."; else expected_valid_outputs.push_back(output); } @@ -290,8 +291,8 @@ void InputModel::override_all_inputs(const std::vector for (const auto& input : inputs) { bool is_correct = is_correct_place(input); if (!is_correct) - NGRAPH_WARN << "Name " << input->get_names().at(0) - << " of input node is not a correct node. Ignoring this parameter."; + OPENVINO_WARN << "Name " << input->get_names().at(0) + << " of input node is not a correct node. Ignoring this parameter."; else expected_valid_inputs.push_back(input); } diff --git a/src/frontends/onnx/frontend/src/op/lstm.cpp b/src/frontends/onnx/frontend/src/op/lstm.cpp index 26bc0cab58e..59594b3a28c 100644 --- a/src/frontends/onnx/frontend/src/op/lstm.cpp +++ b/src/frontends/onnx/frontend/src/op/lstm.cpp @@ -195,7 +195,9 @@ struct LSTMAttributes { m_activation_beta{node.get_attribute_value>("activation_beta", std::vector{})}, m_input_forget{static_cast(node.get_attribute_value("input_forget", 0))} { m_clip_threshold = std::abs(m_clip_threshold); + OPENVINO_SUPPRESS_DEPRECATED_START std::string direction = ngraph::to_lower(node.get_attribute_value("direction", "forward")); + OPENVINO_SUPPRESS_DEPRECATED_END m_direction = ngraph::as_enum(direction); } diff --git a/src/frontends/onnx/frontend/src/op/max_pool.cpp b/src/frontends/onnx/frontend/src/op/max_pool.cpp index 8a13a89cdaa..95589561376 100644 --- a/src/frontends/onnx/frontend/src/op/max_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/max_pool.cpp @@ -6,8 +6,8 @@ #include -#include "ngraph/log.hpp" #include "onnx_import/core/null_node.hpp" +#include "openvino/util/log.hpp" #include "utils/pooling_factory.hpp" namespace ngraph { @@ -16,7 +16,7 @@ namespace op { namespace set_1 { OutputVector max_pool(const Node& node) { if (node.get_outputs_size() > 1) { - NGRAPH_WARN << "MaxPool: Indices output is not supported and was ignored"; + OPENVINO_WARN << "MaxPool: Indices output is not supported and was ignored"; } auto max_pool = pooling::PoolingFactory(node).make_max_pool(); max_pool.emplace_back(std::make_shared()); // Indices (optional) diff --git a/src/frontends/onnx/frontend/src/ops_bridge.cpp b/src/frontends/onnx/frontend/src/ops_bridge.cpp index f87e77e94aa..b5da27ce118 100644 --- a/src/frontends/onnx/frontend/src/ops_bridge.cpp +++ b/src/frontends/onnx/frontend/src/ops_bridge.cpp @@ -176,6 +176,7 @@ #include "op/upsample.hpp" #include "op/where.hpp" #include "op/xor.hpp" +#include "openvino/util/log.hpp" using namespace ov::frontend::onnx; @@ -210,8 +211,8 @@ void OperatorsBridge::register_operator_in_custom_domain(std::string name, register_operator(name, version, domain, fn); } if (!warning_mes.empty()) { - NGRAPH_WARN << "Operator: " << name << " since version: " << range.m_since - << " until version: " << range.m_until << " registered with warning: " << warning_mes; + OPENVINO_WARN << "Operator: " << name << " since version: " << range.m_since + << " until version: " << range.m_until << " registered with warning: " << warning_mes; } } @@ -228,26 +229,26 @@ void OperatorsBridge::register_operator(const std::string& name, m_map[domain][name].emplace(version, std::move(fn)); } else { it->second = std::move(fn); - NGRAPH_WARN << "Overwriting existing operator: " << (domain.empty() ? "ai.onnx" : domain) - << "." + name + ":" + std::to_string(version); + OPENVINO_WARN << "Overwriting existing operator: " << (domain.empty() ? "ai.onnx" : domain) + << "." + name + ":" + std::to_string(version); } } void OperatorsBridge::unregister_operator(const std::string& name, int64_t version, const std::string& domain) { auto domain_it = m_map.find(domain); if (domain_it == m_map.end()) { - NGRAPH_ERR << "unregister_operator: domain '" + domain + "' was not registered before"; + OPENVINO_ERR << "unregister_operator: domain '" + domain + "' was not registered before"; return; } auto name_it = domain_it->second.find(name); if (name_it == domain_it->second.end()) { - NGRAPH_ERR << "unregister_operator: operator '" + name + "' was not registered before"; + OPENVINO_ERR << "unregister_operator: operator '" + name + "' was not registered before"; return; } auto version_it = name_it->second.find(version); if (version_it == name_it->second.end()) { - NGRAPH_ERR << "unregister_operator: operator '" + name + "' with version " + std::to_string(version) + - " was not registered before"; + OPENVINO_ERR << "unregister_operator: operator '" + name + "' with version " + std::to_string(version) + + " was not registered before"; return; } m_map[domain][name].erase(version_it); @@ -264,12 +265,12 @@ OperatorSet OperatorsBridge::get_operator_set(const std::string& domain, int64_t const auto dm = m_map.find(domain); if (dm == std::end(m_map)) { - NGRAPH_DEBUG << "Domain '" << domain << "' not recognized by nGraph"; + OPENVINO_DEBUG << "Domain '" << domain << "' not recognized by nGraph"; return result; } if (domain == "" && version > LATEST_SUPPORTED_ONNX_OPSET_VERSION) { - NGRAPH_WARN << "Currently ONNX operator set version: " << version - << " is unsupported. Falling back to: " << LATEST_SUPPORTED_ONNX_OPSET_VERSION; + OPENVINO_WARN << "Currently ONNX operator set version: " << version + << " is unsupported. Falling back to: " << LATEST_SUPPORTED_ONNX_OPSET_VERSION; } for (const auto& op : dm->second) { const auto& it = find(version, op.second); diff --git a/src/frontends/onnx/frontend/src/utils/recurrent.cpp b/src/frontends/onnx/frontend/src/utils/recurrent.cpp index 9df39fcdaef..ebb2576dae9 100644 --- a/src/frontends/onnx/frontend/src/utils/recurrent.cpp +++ b/src/frontends/onnx/frontend/src/utils/recurrent.cpp @@ -110,7 +110,9 @@ OpAttributes::OpAttributes(const Node& node) m_activations_alpha{node.get_attribute_value>("activation_alpha", std::vector{})}, m_activations_beta{node.get_attribute_value>("activation_beta", std::vector{})} { m_clip_threshold = std::abs(m_clip_threshold); + OPENVINO_SUPPRESS_DEPRECATED_START std::string direction = ngraph::to_lower(node.get_attribute_value("direction", "forward")); + OPENVINO_SUPPRESS_DEPRECATED_END m_direction = ngraph::as_enum(direction); } diff --git a/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp b/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp index a1222ed9a09..b12696192c5 100644 --- a/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp +++ b/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp @@ -9,8 +9,8 @@ #include "exceptions.hpp" #include "ngraph/file_util.hpp" -#include "ngraph/log.hpp" #include "openvino/util/file_util.hpp" +#include "openvino/util/log.hpp" namespace ngraph { namespace onnx_import { @@ -58,7 +58,7 @@ std::string TensorExternalData::load_external_data(const std::string& model_dir) external_data_stream.seekg(m_offset, std::ios::beg); if (m_sha1_digest.size() > 0) { - NGRAPH_WARN << "SHA1 checksum is not supported"; + OPENVINO_WARN << "SHA1 checksum is not supported"; } std::string read_data; diff --git a/src/inference/src/os/mac/mac_system_conf.cpp b/src/inference/src/os/mac/mac_system_conf.cpp index 3960186528c..174168fe702 100644 --- a/src/inference/src/os/mac/mac_system_conf.cpp +++ b/src/inference/src/os/mac/mac_system_conf.cpp @@ -14,11 +14,7 @@ namespace ov { CPU::CPU() { _num_threads = parallel_get_max_threads(); - parse_processor_info_macos( - _processors, - _numa_nodes, - _cores, - _proc_type_table); + parse_processor_info_macos(_processors, _numa_nodes, _cores, _proc_type_table); } int parse_processor_info_macos(int& _processors, diff --git a/src/plugins/template/backend/CMakeLists.txt b/src/plugins/template/backend/CMakeLists.txt index b88b7f5c046..216158dea51 100644 --- a/src/plugins/template/backend/CMakeLists.txt +++ b/src/plugins/template/backend/CMakeLists.txt @@ -2,6 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # +add_definitions(-DIN_OV_COMPONENT) +ov_deprecated_no_errors() + file(GLOB OPS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/ops/*.cpp" ) diff --git a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/common/builders.hpp b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/common/builders.hpp index ba643989184..a643a4ead67 100644 --- a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/common/builders.hpp +++ b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/common/builders.hpp @@ -39,7 +39,7 @@ std::shared_ptr makeElementwise(const std::shared_ptr data, } } - const auto operationConst = std::make_shared( + const auto operationConst = std::make_shared( description.outPrecision, shape, description.values); @@ -55,10 +55,10 @@ std::shared_ptr makeElementwise(const std::shared_ptr data, ngraph::pass::low_precision::NetworkHelper::setOutDataPrecision(operation, description.outPrecision); } - if (ov::is_type(operation) || ov::is_type(operation)) { + if (ov::is_type(operation) || ov::is_type(operation)) { replace_node( operationConst, - ngraph::pass::low_precision::fold(operationConst, data->get_output_element_type(0))); + ngraph::pass::low_precision::fold(operationConst, data->get_output_element_type(0))); } return operation; @@ -74,25 +74,25 @@ std::shared_ptr makeReshape(const Output& data, const Reshape& resha std::shared_ptr makeTranspose(const Output& data, const Transpose& reshape); -std::shared_ptr makeFakeQuantize( +std::shared_ptr makeFakeQuantize( const Output& output, const ngraph::element::Type precision, const FakeQuantizeOnData& fqOnData); -std::shared_ptr makeConvolution(const Output& output, const Convolution& convolution); +std::shared_ptr makeConvolution(const Output& output, const Convolution& convolution); -std::shared_ptr makeFakeQuantizeTypeRelaxed( +std::shared_ptr makeFakeQuantizeTypeRelaxed( const Output& output, const ngraph::element::Type precision, const FakeQuantizeOnData& fqOnData); -std::shared_ptr makeFakeQuantize( +std::shared_ptr makeFakeQuantize( const Output& input, const ngraph::element::Type constantPrecision, const FakeQuantizeOnDataWithConstant& fqOnData, const bool subgraphOnConstantPath = false); -std::shared_ptr makeFakeQuantizeTypeRelaxed( +std::shared_ptr makeFakeQuantizeTypeRelaxed( const std::shared_ptr& input, const ngraph::element::Type constantPrecision, const FakeQuantizeOnDataWithConstant& fqOnData); diff --git a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/concat_function.hpp b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/concat_function.hpp index c89aa67104f..f2e4981fa3e 100644 --- a/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/concat_function.hpp +++ b/src/tests/ngraph_helpers/lpt_ngraph_functions/include/lpt_ngraph_functions/concat_function.hpp @@ -29,10 +29,10 @@ public: static std::shared_ptr getOriginal( const ngraph::element::Type precision, const ngraph::PartialShape& inputShape, - const std::shared_ptr& input_constant1, + const std::shared_ptr& input_constant1, const FakeQuantizeOnData& fakeQuantize1, const DequantizationOperations& dequantization1, - const std::shared_ptr& input_constant2, + const std::shared_ptr& input_constant2, const FakeQuantizeOnData& fakeQuantize2, const DequantizationOperations& dequantization2); diff --git a/src/tests/util/matcher.hpp b/src/tests/util/matcher.hpp index 6a787b2865e..59d5d7ff1d0 100644 --- a/src/tests/util/matcher.hpp +++ b/src/tests/util/matcher.hpp @@ -4,6 +4,7 @@ #include "ngraph/log.hpp" #include "ngraph/pattern/matcher.hpp" +#include "openvino/util/log.hpp" // this is for more nuanced testing class TestMatcher : public ngraph::pattern::Matcher { @@ -28,8 +29,8 @@ public: bool match(const std::shared_ptr& pattern_node, const std::shared_ptr& graph_node) { NGRAPH_CHECK(pattern_node && graph_node); // the same condition throws an exception in the // non-test version of `match` - NGRAPH_DEBUG << "Starting match pattern = " << pattern_node->get_name() - << " , graph_node = " << graph_node->get_name(); + OPENVINO_DEBUG << "Starting match pattern = " << pattern_node->get_name() + << " , graph_node = " << graph_node->get_name(); m_pattern_node = pattern_node; return ngraph::pattern::Matcher::match(graph_node, ngraph::pattern::PatternValueMap{}); diff --git a/src/tests/util/visitor.hpp b/src/tests/util/visitor.hpp index cd2987b6fc2..a274693eaeb 100644 --- a/src/tests/util/visitor.hpp +++ b/src/tests/util/visitor.hpp @@ -14,7 +14,9 @@ #include "ngraph/op/util/framework_node.hpp" #include "ngraph/ops.hpp" #include "ngraph/runtime/host_tensor.hpp" +#include "openvino/core/deprecated.hpp" +OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { namespace test { class ValueHolder { @@ -430,3 +432,4 @@ protected: }; } // namespace test } // namespace ngraph +OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/tools/mo/unit_tests/mock_mo_frontend/mock_mo_frontend/mock_mo_frontend.hpp b/tools/mo/unit_tests/mock_mo_frontend/mock_mo_frontend/mock_mo_frontend.hpp index bea10caac06..67a39b895bb 100644 --- a/tools/mo/unit_tests/mock_mo_frontend/mock_mo_frontend/mock_mo_frontend.hpp +++ b/tools/mo/unit_tests/mock_mo_frontend/mock_mo_frontend/mock_mo_frontend.hpp @@ -4,7 +4,7 @@ #pragma once -#include "ngraph/visibility.hpp" +#include "openvino/core/visibility.hpp" #include "openvino/frontend/manager.hpp" #include "openvino/frontend/visibility.hpp"