diff --git a/samples/cpp/common/utils/include/samples/common.hpp b/samples/cpp/common/utils/include/samples/common.hpp index 6b3f7270c54..047e88b24ca 100644 --- a/samples/cpp/common/utils/include/samples/common.hpp +++ b/samples/cpp/common/utils/include/samples/common.hpp @@ -44,7 +44,7 @@ static constexpr char pcSimpleSort[] = "simple_sort"; /** * @brief Unicode string wrappers */ -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) # define tchar wchar_t # define tstring std::wstring # define tmain wmain @@ -56,7 +56,7 @@ static constexpr char pcSimpleSort[] = "simple_sort"; # define TSTRING2STRING(tstr) tstr #endif -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) /** * @brief Convert wstring to string diff --git a/src/core/include/ngraph/axis_set.hpp b/src/core/include/ngraph/axis_set.hpp index 9bcf8a06b4e..97672a33882 100644 --- a/src/core/include/ngraph/axis_set.hpp +++ b/src/core/include/ngraph/axis_set.hpp @@ -19,7 +19,6 @@ #include #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/core/axis_set.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/axis_vector.hpp b/src/core/include/ngraph/axis_vector.hpp index bb02571c1d4..cc8616a2d27 100644 --- a/src/core/include/ngraph/axis_vector.hpp +++ b/src/core/include/ngraph/axis_vector.hpp @@ -18,7 +18,6 @@ #include #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/core/axis_vector.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/check.hpp b/src/core/include/ngraph/check.hpp deleted file mode 100644 index aa1d0b72230..00000000000 --- a/src/core/include/ngraph/check.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// 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 -#include -#include - -#include "openvino/core/except.hpp" - -namespace ngraph { -using ov::write_all_to_stream; - -using CheckFailure = ov::AssertFailure; -} // namespace ngraph - -#define NGRAPH_CHECK_HELPER2(exc_class, ctx, check, ...) OPENVINO_ASSERT_HELPER2(exc_class, ctx, check, __VA_ARGS__) - -#define NGRAPH_CHECK_HELPER1(exc_class, ctx, check) OPENVINO_ASSERT_HELPER1(exc_class, ctx, check) - -#define NGRAPH_CHECK(...) OPENVINO_ASSERT(__VA_ARGS__) - -#define NGRAPH_UNREACHABLE(...) NGRAPH_CHECK(false, "Unreachable: ", __VA_ARGS__) -#define NGRAPH_CHECK_HELPER(exc_class, ctx, ...) OPENVINO_ASSERT_HELPER(exc_class, ctx, __VA_ARGS__) diff --git a/src/core/include/ngraph/coordinate_diff.hpp b/src/core/include/ngraph/coordinate_diff.hpp index 669f72affa7..b8d85b0b271 100644 --- a/src/core/include/ngraph/coordinate_diff.hpp +++ b/src/core/include/ngraph/coordinate_diff.hpp @@ -18,7 +18,6 @@ #include #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/core/coordinate_diff.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/deprecated.hpp b/src/core/include/ngraph/deprecated.hpp deleted file mode 100644 index e6ed8371daa..00000000000 --- a/src/core/include/ngraph/deprecated.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 "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/enum_names.hpp b/src/core/include/ngraph/enum_names.hpp index 637e7aa0e3e..098f9bb1547 100644 --- a/src/core/include/ngraph/enum_names.hpp +++ b/src/core/include/ngraph/enum_names.hpp @@ -14,7 +14,6 @@ # endif #endif -#include "ngraph/check.hpp" #include "openvino/core/enum_names.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/env_util.hpp b/src/core/include/ngraph/env_util.hpp index b11947531dd..501b0bd84fe 100644 --- a/src/core/include/ngraph/env_util.hpp +++ b/src/core/include/ngraph/env_util.hpp @@ -15,24 +15,30 @@ #endif #include -#include #include -#include "ngraph/deprecated.hpp" +#include "openvino/core/core_visibility.hpp" +#include "openvino/core/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_DEPRECATED NGRAPH_API std::string getenv_string(const char* env_var); +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") +OPENVINO_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_DEPRECATED NGRAPH_API int32_t getenv_int(const char* env_var, int32_t default_value = -1); +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") +OPENVINO_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 @@ -42,5 +48,8 @@ NGRAPH_API_DEPRECATED NGRAPH_API int32_t getenv_int(const char* env_var, int32_t /// \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_DEPRECATED NGRAPH_API bool getenv_bool(const char* env_var, bool default_value = false); +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") +OPENVINO_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 8a77cb3e8ae..a2a17432eff 100644 --- a/src/core/include/ngraph/evaluator.hpp +++ b/src/core/include/ngraph/evaluator.hpp @@ -18,8 +18,8 @@ #include #include -#include "ngraph/deprecated.hpp" #include "ngraph/shape.hpp" +#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" #include "openvino/core/type/element_type_traits.hpp" @@ -28,8 +28,10 @@ namespace ngraph { /// /// template -class NGRAPH_API_DEPRECATED Evaluator { - NGRAPH_SUPPRESS_DEPRECATED_START +class 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") Evaluator { + OPENVINO_SUPPRESS_DEPRECATED_START public: /// \brief values we compute for outputs using value_map = std::map; @@ -184,6 +186,6 @@ protected: op_handler_map m_handlers; op_handler m_default_handler; value_map& m_value_map; - NGRAPH_SUPPRESS_DEPRECATED_END + OPENVINO_SUPPRESS_DEPRECATED_END }; } // namespace ngraph diff --git a/src/core/include/ngraph/graph_util.hpp b/src/core/include/ngraph/graph_util.hpp index 488a8077591..098feac3dda 100644 --- a/src/core/include/ngraph/graph_util.hpp +++ b/src/core/include/ngraph/graph_util.hpp @@ -24,8 +24,6 @@ #include #include -#include "ngraph/check.hpp" -#include "ngraph/deprecated.hpp" #include "openvino/core/graph_util.hpp" namespace ov { @@ -55,13 +53,18 @@ using ov::traverse_nodes; using NodeMap = std::unordered_map>; -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API ov::NodeVector find_common_args(std::shared_ptr target, std::shared_ptr replacement); /// Topological sort of just nodes template -NGRAPH_API_DEPRECATED std::vector> subgraph_topological_sort(T nodes) { +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") +std::vector> subgraph_topological_sort(T nodes) { std::stack> nodes_to_do; std::unordered_set nodes_done; std::unordered_set nodes_to_emit; @@ -110,7 +113,10 @@ NGRAPH_API_DEPRECATED std::vector> subgraph_topologica } template -NGRAPH_API_DEPRECATED void validate_nodes_and_infer_types(const T& nodes) { +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") +void validate_nodes_and_infer_types(const T& nodes) { OPENVINO_SUPPRESS_DEPRECATED_START for (auto& node : subgraph_topological_sort(nodes)) { node->revalidate_and_infer_types(); @@ -119,58 +125,78 @@ NGRAPH_API_DEPRECATED void validate_nodes_and_infer_types(const T& nodes) { } // Check if all paths from X to a result go through Y -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_post_dominated(ov::Node* X, ov::Node* Y); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_equal_to_const_value(const std::string& const_value, const ov::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 +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") +OPENVINO_API std::vector> clone_nodes(const std::vector>& nodes, NodeMap& node_map); // 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 +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") +OPENVINO_API std::list> clone_nodes(const std::vector>& nodes, ov::RawNodeOutputMap& node_map); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_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 +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") +OPENVINO_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_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API std::shared_ptr make_zero(const ov::element::Type& element_type, const ov::Shape& shape); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API std::shared_ptr make_constant_from_string(std::string val, const ov::element::Type& element_type, const ov::Shape& shape); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_zero(const ov::Output& reduce_constant); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API ov::NodeVector get_subgraph_outputs(const ov::NodeVector& nodes, const ov::NodeVector& exclusions, bool ignore_unused = false, @@ -179,55 +205,75 @@ ov::NodeVector get_subgraph_outputs(const ov::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 +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") +OPENVINO_API ov::NodeVector extract_subgraph(const ov::NodeVector& results, const ov::NodeVector& args); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_one(const ov::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 +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") +OPENVINO_API bool is_used(ov::Node* node); // Returns count of `node` users that are still live in the graph -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API size_t get_user_count(ov::Node* node); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_strided(const ov::Strides& strides); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool is_valid_rank(const std::shared_ptr& node, std::vector valid_ranks); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API void plot_graph(std::shared_ptr f, const std::string& filename, std::function& attributes)> = nullptr); /// \return A vector containing handles for each input of dst that is connected to an output /// of `src`. -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API std::vector> get_inputs_from(ov::Node& src, ov::Node& dst); /// \return A vector containing a handle for each output of src that is connected to an input /// of `dst`. -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API std::vector> get_outputs_to(ov::Node& src, ov::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_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API bool check_for_cycles(const ov::Model* func, ov::NodeVector& cycle_nodes, bool& is_bkwd_cycle); } // namespace ngraph diff --git a/src/core/include/ngraph/ngraph_visibility.hpp b/src/core/include/ngraph/ngraph_visibility.hpp deleted file mode 100644 index 2a2c26f79be..00000000000 --- a/src/core/include/ngraph/ngraph_visibility.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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 "openvino/core/core_visibility.hpp" - -#define NGRAPH_API OPENVINO_API -#define NGRAPH_API_C OPENVINO_API_C -#define NGRAPH_EXTERN_C OPENVINO_EXTERN_C - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# ifndef ENABLE_UNICODE_PATH_SUPPORT -# define ENABLE_UNICODE_PATH_SUPPORT -# endif -#endif diff --git a/src/core/include/ngraph/op/util/attr_types.hpp b/src/core/include/ngraph/op/util/attr_types.hpp index ea56388b492..16321461a81 100644 --- a/src/core/include/ngraph/op/util/attr_types.hpp +++ b/src/core/include/ngraph/op/util/attr_types.hpp @@ -17,7 +17,6 @@ #include #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/op/util/attr_types.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/op/util/op_types.hpp b/src/core/include/ngraph/op/util/op_types.hpp index bd882f0e482..e431fbd878b 100644 --- a/src/core/include/ngraph/op/util/op_types.hpp +++ b/src/core/include/ngraph/op/util/op_types.hpp @@ -16,7 +16,6 @@ #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/op/util/op_types.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/shape.hpp b/src/core/include/ngraph/shape.hpp index 09d5a3964c4..d8b26eae42a 100644 --- a/src/core/include/ngraph/shape.hpp +++ b/src/core/include/ngraph/shape.hpp @@ -19,7 +19,6 @@ #include #include "ngraph/axis_set.hpp" -#include "ngraph/ngraph_visibility.hpp" #include "ngraph/strides.hpp" #include "openvino/core/shape.hpp" diff --git a/src/core/include/ngraph/specialize_function.hpp b/src/core/include/ngraph/specialize_function.hpp index 67c3c0636ff..97945a93e84 100644 --- a/src/core/include/ngraph/specialize_function.hpp +++ b/src/core/include/ngraph/specialize_function.hpp @@ -16,8 +16,7 @@ #include -#include "ngraph/deprecated.hpp" -#include "ngraph/ngraph_visibility.hpp" +#include "openvino/core/deprecated.hpp" #include "openvino/core/model.hpp" #include "openvino/core/shape.hpp" #include "openvino/core/type.hpp" @@ -105,8 +104,10 @@ namespace ngraph { /// which a Constant node with element type parameter_element_types[i] and shape /// parameter_shapes[i] can be created. /// -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API std::shared_ptr specialize_function(std::shared_ptr f, const std::vector& parameter_element_types, const std::vector& parameter_shapes, diff --git a/src/core/include/ngraph/strides.hpp b/src/core/include/ngraph/strides.hpp index c961334402d..9247549050b 100644 --- a/src/core/include/ngraph/strides.hpp +++ b/src/core/include/ngraph/strides.hpp @@ -18,7 +18,6 @@ #include #include -#include "ngraph/ngraph_visibility.hpp" #include "openvino/core/strides.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/util.hpp b/src/core/include/ngraph/util.hpp index 01e5dab9dbc..991ff9d1f60 100644 --- a/src/core/include/ngraph/util.hpp +++ b/src/core/include/ngraph/util.hpp @@ -46,9 +46,12 @@ using ov::Node; class stopwatch; class Tensor; -NGRAPH_SUPPRESS_DEPRECATED_START +OPENVINO_SUPPRESS_DEPRECATED_START template -NGRAPH_API_DEPRECATED std::string join(const T& v, const std::string& sep = ", ") { +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") +std::string join(const T& v, const std::string& sep = ", ") { std::ostringstream ss; size_t count = 0; for (const auto& x : v) { @@ -61,40 +64,58 @@ NGRAPH_API_DEPRECATED std::string join(const T& v, const std::string& sep = ", " } template -NGRAPH_API_DEPRECATED std::string vector_to_string(const T& v) { +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") +std::string vector_to_string(const T& v) { std::ostringstream os; os << "[ " << ngraph::join(v) << " ]"; return os.str(); } -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") size_t hash_combine(const std::vector& list); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") void dump(std::ostream& out, const void*, size_t); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") std::string to_lower(const std::string& s); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") std::string to_upper(const std::string& s); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") std::string trim(const std::string& s); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") std::vector split(const std::string& s, char delimiter, bool trim = false); template -NGRAPH_API_DEPRECATED std::string locale_string(T x) { +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") +std::string locale_string(T x) { std::stringstream ss; ss.imbue(std::locale("")); ss << x; return ss.str(); } -class NGRAPH_API NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon") stopwatch { +class OPENVINO_API OPENVINO_DEPRECATED("It is obsolete structure and will be removed soon") stopwatch { public: void start() { if (m_active == false) { @@ -136,7 +157,10 @@ private: /// Parses a string containing a literal of the underlying type. template -NGRAPH_API_DEPRECATED T parse_string(const std::string& s) { +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") +T parse_string(const std::string& s) { T result; std::stringstream ss; @@ -154,65 +178,100 @@ NGRAPH_API_DEPRECATED T parse_string(const std::string& s) { /// template specializations for float and double to handle INFINITY, -INFINITY /// and NaN values. template <> -NGRAPH_API_DEPRECATED NGRAPH_API float parse_string(const std::string& s); +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") +OPENVINO_API float parse_string(const std::string& s); template <> -NGRAPH_API_DEPRECATED NGRAPH_API double parse_string(const std::string& s); +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") +OPENVINO_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_API_DEPRECATED NGRAPH_API int8_t parse_string(const std::string& s); +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") +OPENVINO_API int8_t parse_string(const std::string& s); template <> -NGRAPH_API_DEPRECATED NGRAPH_API uint8_t parse_string(const std::string& s); +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") +OPENVINO_API uint8_t parse_string(const std::string& s); /// Parses a list of strings containing literals of the underlying type. template -NGRAPH_API_DEPRECATED std::vector parse_string(const std::vector& ss) { - NGRAPH_SUPPRESS_DEPRECATED_START +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") +std::vector parse_string(const std::vector& ss) { + OPENVINO_SUPPRESS_DEPRECATED_START std::vector result(ss.size()); std::transform(ss.begin(), ss.end(), result.begin(), [](const std::string& s) { return parse_string(s); }); return result; - NGRAPH_SUPPRESS_DEPRECATED_END + OPENVINO_SUPPRESS_DEPRECATED_END } template -NGRAPH_API_DEPRECATED T ceil_div(const T& x, const T& y) { +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") +T ceil_div(const T& x, const T& y) { return (x == 0 ? 0 : (1 + (x - 1) / y)); } template -NGRAPH_API_DEPRECATED T subtract_or_zero(T x, T y) { +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") +T subtract_or_zero(T x, T y) { return y > x ? 0 : x - y; } -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") void* ngraph_malloc(size_t size); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") void ngraph_free(void*); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") size_t round_up(size_t size, size_t alignment); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") AxisVector get_default_order(size_t rank); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") AxisVector get_default_order(const ov::Rank& rank); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") AxisVector get_default_order(const ov::Shape& shape); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") AxisVector get_default_order(const ov::PartialShape& shape); /// \brief Function to query parsed version information of the version of ngraph which @@ -226,12 +285,17 @@ AxisVector get_default_order(const ov::PartialShape& shape); /// the patch version number. /// /// \note Throws a runtime_error if there is an error during parsing -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") void parse_version_string(std::string version, size_t& major, size_t& minor, size_t& patch, std::string& extra); template -NGRAPH_API_DEPRECATED T double_to_int(double x, double float_to_int_converter(double)) { +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") +T double_to_int(double x, double float_to_int_converter(double)) { if (!std::is_integral()) { OPENVINO_THROW("Function double_to_int template parameter must be an integral type."); } @@ -253,7 +317,10 @@ NGRAPH_API_DEPRECATED T double_to_int(double x, double float_to_int_converter(do } // end namespace ngraph template -NGRAPH_API_DEPRECATED std::vector read_vector(std::shared_ptr tv) { +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") +std::vector read_vector(std::shared_ptr tv) { if (ov::element::from() != tv->get_element_type()) { OPENVINO_THROW("read_vector type must match Tensor type"); } @@ -265,8 +332,10 @@ NGRAPH_API_DEPRECATED std::vector read_vector(std::shared_ptr tv) } template -NGRAPH_API_DEPRECATED std::vector array_2_vector(typename ov::element_type_traits::value_type* data, - size_t size) { +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") +std::vector array_2_vector(typename ov::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]); @@ -274,13 +343,19 @@ NGRAPH_API_DEPRECATED std::vector array_2_vector(typename ov::element_type_tr return result; } -NGRAPH_API_DEPRECATED -std::vector NGRAPH_API read_float_vector(std::shared_ptr tv); +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") +std::vector OPENVINO_API read_float_vector(std::shared_ptr tv); -NGRAPH_API_DEPRECATED -std::vector NGRAPH_API read_index_vector(std::shared_ptr tv); +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") +std::vector OPENVINO_API read_index_vector(std::shared_ptr tv); -NGRAPH_API -NGRAPH_API_DEPRECATED +OPENVINO_API +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") std::ostream& operator<<(std::ostream& os, const ov::NodeVector& nv); -NGRAPH_SUPPRESS_DEPRECATED_END +OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/validation_util.hpp b/src/core/include/ngraph/validation_util.hpp index ac5a87acd3f..13028b5b5a1 100644 --- a/src/core/include/ngraph/validation_util.hpp +++ b/src/core/include/ngraph/validation_util.hpp @@ -34,20 +34,26 @@ using ov::element::Type; using ov::element::Type_t; } // namespace element -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API Strides conv_default_strides(const Node* node, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API CoordinateDiff conv_default_padding(const Node* node, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, const ov::PartialShape& data_shape, const Strides& data_dilation, @@ -59,7 +65,9 @@ ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, bool is_window_all_in_padding_allowed, bool ceil_mode = false); -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") void validate_conv_params_spatial_dimensions(const Node* node, const size_t num_spatial_dims, const op::PadType auto_pad, @@ -68,8 +76,10 @@ void validate_conv_params_spatial_dimensions(const Node* node, CoordinateDiff& pads_begin, CoordinateDiff& pads_end); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API ov::PartialShape infer_batched_pooling_forward(const Node* node, const ov::PartialShape& data_batch_shape, const CoordinateDiff& data_padding_below, @@ -80,8 +90,10 @@ ov::PartialShape infer_batched_pooling_forward(const Node* node, bool ceil_mode = false, const Strides& window_dilation = Strides{}); -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API ov::PartialShape infer_slice_shape(const Node* node, const ov::PartialShape& input_shape, const std::vector& begin, @@ -97,20 +109,28 @@ ov::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_API_DEPRECATED -NGRAPH_API std::pair maximum_value(const ov::Output& value); +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") +OPENVINO_API std::pair maximum_value(const ov::Output& value); /// \brief Returns a Constant storing scalar value equal to std::numeric_limits::max() -NGRAPH_API_DEPRECATED -NGRAPH_API std::shared_ptr get_constant_max_of_type(element::Type_t t); +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") +OPENVINO_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() -NGRAPH_API_DEPRECATED -NGRAPH_API std::shared_ptr get_constant_min_of_type(element::Type_t t); +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") +OPENVINO_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() -NGRAPH_API_DEPRECATED -NGRAPH_API std::shared_ptr get_constant_lowest_of_type(element::Type_t t); +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") +OPENVINO_API std::shared_ptr get_constant_lowest_of_type(element::Type_t t); namespace opset1 { /// @@ -126,8 +146,10 @@ 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. /// -NGRAPH_API_DEPRECATED -NGRAPH_API +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") +OPENVINO_API void infer_conv_backprop_auto_padding(const Shape& input_data_shape, const Shape& filters_shape, const Shape& output_shape, diff --git a/src/core/src/specialize_function.cpp b/src/core/src/specialize_function.cpp index 5ecc9742772..661d6ba692d 100644 --- a/src/core/src/specialize_function.cpp +++ b/src/core/src/specialize_function.cpp @@ -10,7 +10,7 @@ #include "openvino/op/parameter.hpp" using namespace ngraph; -NGRAPH_SUPPRESS_DEPRECATED_START; +OPENVINO_SUPPRESS_DEPRECATED_START; using ov::op::v0::Constant; diff --git a/src/core/tests/specialize_function.cpp b/src/core/tests/specialize_function.cpp index 9da33c1bd18..dbea227cc74 100644 --- a/src/core/tests/specialize_function.cpp +++ b/src/core/tests/specialize_function.cpp @@ -11,7 +11,7 @@ using namespace ngraph; using namespace ov; -NGRAPH_SUPPRESS_DEPRECATED_START; +OPENVINO_SUPPRESS_DEPRECATED_START; using ov::op::v0::Constant; using ov::op::v0::Convert; @@ -209,7 +209,7 @@ TEST(specialize_function, et_static_shape_rank_static_dynamic_rank_mismatch) { {ov::PartialShape{1, 2, 3}, ov::PartialShape{1, 2, 3, 4}}, param_vals); }, - CheckFailure); + ov::AssertFailure); } // Test specialization of rank-static dynamic shapes, where the replacement shapes have wrong @@ -236,7 +236,7 @@ TEST(specialize_function, et_static_shape_rank_static_dynamic_dim_mismatch) { {ov::PartialShape{1, 2, 3}, ov::PartialShape{1, 9, 4}}, param_vals); }, - CheckFailure); + ov::AssertFailure); } // Test for failure when we supply the wrong number of replacement element types. @@ -258,7 +258,7 @@ TEST(specialize_function, et_count_wrong) { {ov::PartialShape{1, 2, 3}, ov::PartialShape{1, 2, 3}}, param_vals); }, - CheckFailure); + ov::AssertFailure); } // Test for failure when we supply the wrong number of replacement shapes. @@ -280,7 +280,7 @@ TEST(specialize_function, shape_count_wrong) { {ov::PartialShape{1, 2, 3}, ov::PartialShape{1, 2, 3}, ov::PartialShape{4, 5, 6}}, param_vals); }, - CheckFailure); + ov::AssertFailure); } // Test for failure when we supply the wrong number of replacement parameter values. @@ -302,5 +302,5 @@ TEST(specialize_function, value_count_wrong) { {ov::PartialShape{1, 2, 3}, ov::PartialShape{1, 2, 3}}, param_vals); }, - CheckFailure); + ov::AssertFailure); } diff --git a/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp b/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp index 125016ceced..2aa79544427 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp @@ -53,7 +53,9 @@ class Tensor; class SparseTensor; class Attribute; -class NGRAPH_API_DEPRECATED ONNX_IMPORTER_API Node { +class 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") ONNX_IMPORTER_API Node { public: Node() = delete; // TODO: hide this ctor since it uses protobufs generated structures diff --git a/src/frontends/onnx/frontend/include/onnx_import/onnx.hpp b/src/frontends/onnx/frontend/include/onnx_import/onnx.hpp index 4dbe99de0c0..7a235093a1b 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/onnx.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/onnx.hpp @@ -20,8 +20,8 @@ #include #include -#include "ngraph/deprecated.hpp" #include "onnx_importer_visibility.hpp" +#include "openvino/core/deprecated.hpp" #include "openvino/core/model.hpp" /// \brief Top level nGraph namespace. @@ -36,8 +36,10 @@ namespace onnx_import { /// \param[in] domain A domain to get the supported operators for. /// /// \return The set containing names of supported operators. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API std::set get_supported_operators(std::int64_t version, - const std::string& domain); +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") +ONNX_IMPORTER_API std::set get_supported_operators(std::int64_t version, const std::string& domain); /// \brief Determines whether ONNX operator is supported. /// @@ -47,9 +49,12 @@ NGRAPH_API_DEPRECATED ONNX_IMPORTER_API std::set get_supported_oper /// If not set, the default domain "ai.onnx" is used. /// /// \return true if operator is supported, false otherwise. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API bool is_operator_supported(const std::string& op_name, - std::int64_t version, - const std::string& domain = "ai.onnx"); +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") +ONNX_IMPORTER_API bool is_operator_supported(const std::string& op_name, + std::int64_t version, + const std::string& domain = "ai.onnx"); /// \brief Imports and converts an serialized ONNX model from the input stream /// to an nGraph Function representation. @@ -64,9 +69,12 @@ NGRAPH_API_DEPRECATED ONNX_IMPORTER_API bool is_operator_supported(const std::st /// \param[in] enable_mmap Enable mapping files with external weights instead of reading. /// /// \return An nGraph function that represents a single output from the created graph. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API std::shared_ptr import_onnx_model(std::istream& stream, - const std::string& model_path = "", - bool enable_mmap = false); +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") +ONNX_IMPORTER_API std::shared_ptr import_onnx_model(std::istream& stream, + const std::string& model_path = "", + bool enable_mmap = false); /// \brief Imports and converts an ONNX model from the input file /// to an nGraph Function representation. @@ -79,8 +87,10 @@ NGRAPH_API_DEPRECATED ONNX_IMPORTER_API std::shared_ptr import_onnx_m /// \param[in] enable_mmap Enable mapping files with external weights instead of reading. /// /// \return An nGraph function that represents a single output from the created graph. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API std::shared_ptr import_onnx_model(const std::string& file_path, - bool enable_mmap = false); +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") +ONNX_IMPORTER_API std::shared_ptr import_onnx_model(const std::string& file_path, bool enable_mmap = false); } // namespace onnx_import } // namespace ngraph diff --git a/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp b/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp index 8e4de8a6605..ffc9fce5ecf 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp @@ -35,10 +35,13 @@ namespace onnx_import { /// \param domain The domain the ONNX operator is registered to. /// \param fn The function providing the implementation of the operator /// which transforms the single ONNX operator to an nGraph sub-graph. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API void register_operator(const std::string& name, - std::int64_t version, - const std::string& domain, - Operator fn); +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") +ONNX_IMPORTER_API void register_operator(const std::string& name, + std::int64_t version, + const std::string& domain, + Operator fn); /// \brief Unregisters ONNX custom operator. /// The function unregisters previously registered operator. @@ -46,9 +49,10 @@ NGRAPH_API_DEPRECATED ONNX_IMPORTER_API void register_operator(const std::string /// \param name The ONNX operator name. /// \param version The ONNX operator set version. /// \param domain The domain the ONNX operator is registered to. -NGRAPH_API_DEPRECATED ONNX_IMPORTER_API void unregister_operator(const std::string& name, - std::int64_t version, - const std::string& domain); +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") +ONNX_IMPORTER_API void unregister_operator(const std::string& name, std::int64_t version, const std::string& domain); } // namespace onnx_import diff --git a/src/tests/ov_helpers/ov_models/src/utils/ov_helpers.cpp b/src/tests/ov_helpers/ov_models/src/utils/ov_helpers.cpp index a1b670d757b..a4734f24180 100644 --- a/src/tests/ov_helpers/ov_models/src/utils/ov_helpers.cpp +++ b/src/tests/ov_helpers/ov_models/src/utils/ov_helpers.cpp @@ -226,9 +226,9 @@ std::shared_ptr foldFunction(const std::shared_ptr& functi } } - NGRAPH_SUPPRESS_DEPRECATED_START; + OPENVINO_SUPPRESS_DEPRECATED_START; const auto& foldedFunc = ngraph::specialize_function(function, paramElementTypes, paramShapes, inBuffers); - NGRAPH_SUPPRESS_DEPRECATED_END; + OPENVINO_SUPPRESS_DEPRECATED_END; ov::pass::ConstantFolding().run_on_model(foldedFunc); for (const auto& op : foldedFunc->get_ops()) { OPENVINO_ASSERT(ov::op::util::is_constant(op) || ov::op::util::is_output(op) || ov::op::util::is_parameter(op), diff --git a/src/tests/ov_helpers/ov_snippets_models/src/subgraph_simple.cpp b/src/tests/ov_helpers/ov_snippets_models/src/subgraph_simple.cpp index 4821cc6d700..ae740603dc0 100644 --- a/src/tests/ov_helpers/ov_snippets_models/src/subgraph_simple.cpp +++ b/src/tests/ov_helpers/ov_snippets_models/src/subgraph_simple.cpp @@ -209,7 +209,7 @@ std::shared_ptr EltwiseTwoResultsFunction::initOriginal() const { auto relu = std::make_shared(hswish); relu->set_friendly_name("relu"); - NGRAPH_SUPPRESS_DEPRECATED_START + OPENVINO_SUPPRESS_DEPRECATED_START auto& out_tensor0 = add->get_output_tensor(0); ov::descriptor::set_ov_tensor_legacy_name(out_tensor0, "add_out"); out_tensor0.set_names({"add_out", "y0"}); @@ -217,7 +217,7 @@ std::shared_ptr EltwiseTwoResultsFunction::initOriginal() const { auto& out_tensor1 = relu->get_output_tensor(0); ov::descriptor::set_ov_tensor_legacy_name(out_tensor1, "relu_out"); out_tensor1.set_names({"relu_out", "y1"}); - NGRAPH_SUPPRESS_DEPRECATED_END + OPENVINO_SUPPRESS_DEPRECATED_END auto res0 = std::make_shared(add); res0->set_friendly_name("res0"); @@ -248,7 +248,7 @@ std::shared_ptr EltwiseTwoResultsFunction::initReference() const { std::make_shared(NodeVector{relu}, ParameterVector{indata2})); subgraph1->set_friendly_name("relu"); - NGRAPH_SUPPRESS_DEPRECATED_START + OPENVINO_SUPPRESS_DEPRECATED_START auto& out_tensor0 = subgraph0->get_output_tensor(0); ov::descriptor::set_ov_tensor_legacy_name(out_tensor0, "add_out"); out_tensor0.set_names({"add_out", "y0"}); @@ -256,7 +256,7 @@ std::shared_ptr EltwiseTwoResultsFunction::initReference() const { auto& out_tensor1 = subgraph1->get_output_tensor(0); ov::descriptor::set_ov_tensor_legacy_name(out_tensor1, "relu_out"); out_tensor1.set_names({"relu_out", "y1"}); - NGRAPH_SUPPRESS_DEPRECATED_END + OPENVINO_SUPPRESS_DEPRECATED_END auto res0 = std::make_shared(subgraph0->output(0)); res0->set_friendly_name("res0");