From 9bdd36be9c91c952480167dfc23ef2616fd423e4 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Fri, 2 Feb 2024 03:53:20 +0100 Subject: [PATCH] [Core] Remove ngraph env_util.hpp graph_util.hpp util.hpp (#22540) * Delete env_util * Remove ngraph graph_util (initial) TODO: remove ngraph/graph_util.hpp and remains from graph_util.cpp * Remove ngraph util (initial) TODO: remove ngraph/util.hpp and remains from util.cpp * Remove ngraph util (onnx fe not finished) TODO: remove ngraph/util.hpp and util.cpp. * Use OV in test helpers * Remove ngraph graph_util * [ONNX FE] Rename onnx_import::Node class to ONNX_Node temporarily (to hide conflicts with missing Node from ::ngraph::) * Remove ngraph graph_util from onnx fe * [ONNX FE] Rename onnx_import::ONNX_Node class back to Node * Delete ngraph util * Update copyright notes * Update copyright notes * Fix style * Fix gpu plugin * Remove useless macros --------- Co-authored-by: Pavel Durandin --- docs/snippets/ov_model_snippets.cpp | 2 +- docs/snippets/ov_preprocessing.cpp | 9 +- .../template_pattern_transformation.cpp | 3 +- src/common/snippets/src/lowered/linear_ir.cpp | 63 ++- src/core/include/ngraph/env_util.hpp | 55 -- src/core/include/ngraph/graph_util.hpp | 281 ---------- src/core/include/ngraph/util.hpp | 337 ------------ src/core/include/ngraph/validation_util.hpp | 15 +- src/core/include/openvino/op/constant.hpp | 19 +- src/core/src/env_util.cpp | 19 - src/core/src/graph_util.cpp | 489 +----------------- src/core/src/model.cpp | 3 +- src/core/src/node.cpp | 11 +- src/core/src/pass/manager.cpp | 45 +- src/core/src/pattern/matcher.cpp | 33 +- src/core/src/specialize_function.cpp | 6 +- src/core/src/util.cpp | 393 -------------- src/core/src/validation_util.cpp | 37 +- src/core/tests/build_graph.cpp | 8 +- src/core/tests/pattern.cpp | 17 +- src/core/tests/specialize_function.cpp | 2 +- src/core/tests/type_prop/batch_to_space.cpp | 6 +- src/core/tests/type_prop/depth_to_space.cpp | 6 +- .../include/onnx_import/core/node.hpp | 2 +- src/frontends/onnx/frontend/src/core/node.cpp | 10 +- .../onnx/frontend/src/core/sparse_tensor.hpp | 10 +- .../onnx/frontend/src/core/tensor.hpp | 10 +- .../onnx/frontend/src/onnx_framework_node.cpp | 8 +- .../onnx/frontend/src/onnx_framework_node.hpp | 8 +- src/frontends/onnx/frontend/src/op/aten.cpp | 8 +- .../onnx/frontend/src/op/bitshift.cpp | 5 +- .../src/op/com.microsoft/attention.cpp | 3 +- .../embed_layer_normalization.cpp | 3 +- .../src/op/com.microsoft/fused_conv.cpp | 3 +- .../src/op/com.microsoft/fusedgemm.cpp | 3 +- .../skip_layer_normalization.cpp | 3 +- .../onnx/frontend/src/op/compress.cpp | 3 +- .../onnx/frontend/src/op/constant.cpp | 3 +- .../onnx/frontend/src/op/conv_transpose.cpp | 4 +- src/frontends/onnx/frontend/src/op/crop.cpp | 3 +- .../onnx/frontend/src/op/cum_sum.cpp | 4 +- .../frontend/src/op/dequantize_linear.cpp | 4 +- .../onnx/frontend/src/op/dropout.cpp | 7 +- .../src/op/dynamic_quantize_linear.cpp | 3 +- src/frontends/onnx/frontend/src/op/expand.cpp | 3 +- src/frontends/onnx/frontend/src/op/gather.hpp | 4 +- src/frontends/onnx/frontend/src/op/gemm.cpp | 3 +- .../frontend/src/op/global_average_pool.cpp | 3 +- .../onnx/frontend/src/op/global_max_pool.cpp | 3 +- .../frontend/src/op/group_normalization.cpp | 3 +- src/frontends/onnx/frontend/src/op/gru.cpp | 3 +- .../onnx/frontend/src/op/hard_sigmoid.cpp | 3 +- .../onnx/frontend/src/op/hardmax.cpp | 3 +- .../frontend/src/op/layer_normalization.cpp | 1 + .../onnx/frontend/src/op/leaky_relu.cpp | 3 +- .../onnx/frontend/src/op/log_softmax.cpp | 3 +- .../onnx/frontend/src/op/lp_pool.cpp | 3 +- src/frontends/onnx/frontend/src/op/lstm.cpp | 3 +- .../onnx/frontend/src/op/max_roi_pool.cpp | 4 +- src/frontends/onnx/frontend/src/op/mean.cpp | 4 +- .../src/op/mean_variance_normalization.cpp | 4 +- .../onnx/frontend/src/op/nms_rotated.hpp | 8 +- .../frontend/src/op/non_max_suppression.cpp | 3 +- .../generate_proposals.cpp | 3 +- .../src/op/org.openvinotoolkit/normalize.cpp | 3 +- .../src/op/org.openvinotoolkit/prior_box.cpp | 3 +- .../src/op/org.openvinotoolkit/swish.cpp | 3 +- .../onnx/frontend/src/op/quantize_linear.cpp | 3 +- .../onnx/frontend/src/op/random_normal.cpp | 3 +- .../frontend/src/op/random_normal_like.cpp | 3 +- .../onnx/frontend/src/op/reciprocal.cpp | 3 +- src/frontends/onnx/frontend/src/op/reduce.cpp | 3 +- src/frontends/onnx/frontend/src/op/scan.cpp | 6 +- src/frontends/onnx/frontend/src/op/selu.cpp | 6 +- src/frontends/onnx/frontend/src/op/shrink.cpp | 10 +- src/frontends/onnx/frontend/src/op/size.cpp | 4 +- src/frontends/onnx/frontend/src/op/slice.cpp | 4 +- .../onnx/frontend/src/op/softmax.cpp | 6 +- src/frontends/onnx/frontend/src/op/split.cpp | 4 +- .../onnx/frontend/src/op/squeeze.cpp | 4 +- src/frontends/onnx/frontend/src/op/stft.cpp | 3 +- .../onnx/frontend/src/op/thresholded_relu.cpp | 4 +- src/frontends/onnx/frontend/src/op/trilu.cpp | 13 +- .../onnx/frontend/src/op/upsample.cpp | 6 +- .../onnx/frontend/src/utils/common.cpp | 3 +- .../onnx/frontend/src/utils/common.hpp | 6 +- .../onnx/frontend/src/utils/convpool.hpp | 16 +- .../frontend/src/utils/pooling_factory.cpp | 3 +- .../frontend/src/utils/pooling_factory.hpp | 12 +- .../onnx/frontend/src/utils/recurrent.cpp | 3 +- .../onnx/frontend/src/utils/reshape.cpp | 3 +- src/inference/src/dev/plugin.cpp | 2 +- .../mvn_transformation.cpp | 4 +- .../single_layer_tests/topk.cpp | 2 +- .../fuse_convert_transformation.hpp | 4 +- .../mvn_transformation.hpp | 4 +- .../functional/plugin/shared/src/precomp.hpp | 1 - .../single_layer/broadcast.hpp | 15 +- .../single_layer/interpolate.hpp | 26 +- .../shared_test_classes/single_layer/mvn.hpp | 20 +- .../single_layer/extract_image_patches.cpp | 9 +- .../src/single_layer/interpolate.cpp | 2 +- .../src/single_layer/memory.cpp | 4 +- .../src/single_layer/mvn.cpp | 2 +- .../src/single_layer/non_max_suppression.cpp | 11 +- .../ov_models/include/ov_models/builders.hpp | 175 ++++--- .../include/ov_models/pass/convert_prc.hpp | 4 +- .../ov_models/ov_builders/src/broadcast.cpp | 16 +- .../ov_models/ov_builders/src/norm.cpp | 71 +-- .../ov_models/ov_builders/src/reshape.cpp | 14 +- .../ov_models/ov_builders/src/split.cpp | 6 +- .../ov_helpers/ov_models/src/activation.cpp | 4 +- .../ov_models/src/batch_to_space.cpp | 4 +- .../ov_models/src/binary_convolution.cpp | 22 +- .../ov_helpers/ov_models/src/comparison.cpp | 6 +- .../ov_helpers/ov_models/src/convolution.cpp | 50 +- .../src/convolution_backprop_data.cpp | 78 +-- .../ov_models/src/ctc_greedy_decoder.cpp | 4 +- .../src/ctc_greedy_decoder_seq_len.cpp | 8 +- .../ov_helpers/ov_models/src/ctc_loss.cpp | 22 +- src/tests/ov_helpers/ov_models/src/dft.cpp | 4 +- .../ov_helpers/ov_models/src/eltwise.cpp | 8 +- .../src/embedding_bag_offsets_sum.cpp | 20 +- .../ov_models/src/embedding_segments_sum.cpp | 22 +- .../ov_models/src/fake_quantize.cpp | 18 +- .../ov_models/src/fully_connected.cpp | 16 +- .../ov_helpers/ov_models/src/gather_nd.cpp | 18 +- .../ov_models/src/group_convolution.cpp | 48 +- .../src/group_convolution_backprop_data.cpp | 82 +-- .../ov_helpers/ov_models/src/gru_cell.cpp | 4 +- .../ov_helpers/ov_models/src/logical.cpp | 6 +- .../ov_helpers/ov_models/src/lstm_cell.cpp | 6 +- .../ov_models/src/minimum_maximum.cpp | 6 +- src/tests/ov_helpers/ov_models/src/mvn.cpp | 19 +- .../ov_models/src/non_max_suppression.cpp | 10 +- src/tests/ov_helpers/ov_models/src/pad.cpp | 4 +- .../ov_helpers/ov_models/src/pooling.cpp | 20 +- .../ov_helpers/ov_models/src/proposal.cpp | 38 +- src/tests/ov_helpers/ov_models/src/rdft.cpp | 4 +- .../ov_helpers/ov_models/src/rnn_cell.cpp | 4 +- .../ov_models/src/space_to_batch.cpp | 4 +- src/tests/ov_helpers/ov_models/src/split.cpp | 4 +- .../ov_models/src/squeeze_unsqueeze.cpp | 4 +- .../ov_models/src/strided_slice.cpp | 22 +- .../src/subgraph_simple.cpp | 4 +- 145 files changed, 884 insertions(+), 2274 deletions(-) delete mode 100644 src/core/include/ngraph/env_util.hpp delete mode 100644 src/core/include/ngraph/graph_util.hpp delete mode 100644 src/core/include/ngraph/util.hpp delete mode 100644 src/core/src/env_util.cpp delete mode 100644 src/core/src/util.cpp diff --git a/docs/snippets/ov_model_snippets.cpp b/docs/snippets/ov_model_snippets.cpp index f821007ebed..0a7cc8ad0f0 100644 --- a/docs/snippets/ov_model_snippets.cpp +++ b/docs/snippets/ov_model_snippets.cpp @@ -297,7 +297,7 @@ auto pow = std::make_shared(div->input(1).get_source_output() ov::op::v0::Constant::create(div->get_input_element_type(1), ov::Shape{1}, {-1})); auto mul = std::make_shared(div->input(0).get_source_output(), pow); mul->set_friendly_name(div->get_friendly_name()); -ngraph::replace_node(div, mul); +ov::replace_node(div, mul); // ! [ov:replace_friendly_name] } diff --git a/docs/snippets/ov_preprocessing.cpp b/docs/snippets/ov_preprocessing.cpp index 176953f4669..640e13b142c 100644 --- a/docs/snippets/ov_preprocessing.cpp +++ b/docs/snippets/ov_preprocessing.cpp @@ -1,9 +1,10 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // -#include -#include -#include +#include "openvino/core/graph_util.hpp" +#include "openvino/core/preprocess/pre_post_process.hpp" +#include "openvino/opsets/opset8.hpp" +#include "openvino/runtime/core.hpp" void ppp_input_1(ov::preprocess::PrePostProcessor& ppp) { //! [ov:preprocess:input_1] diff --git a/docs/snippets/template_pattern_transformation.cpp b/docs/snippets/template_pattern_transformation.cpp index 40aeec26c82..e1b82c441e3 100644 --- a/docs/snippets/template_pattern_transformation.cpp +++ b/docs/snippets/template_pattern_transformation.cpp @@ -1,10 +1,11 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include "template_pattern_transformation.hpp" #include "openvino/cc/pass/itt.hpp" +#include "openvino/core/graph_util.hpp" #include "openvino/core/rt_info.hpp" #include "openvino/opsets/opset3.hpp" #include "openvino/pass/manager.hpp" diff --git a/src/common/snippets/src/lowered/linear_ir.cpp b/src/common/snippets/src/lowered/linear_ir.cpp index a29d8d2045a..65eb3f741cc 100644 --- a/src/common/snippets/src/lowered/linear_ir.cpp +++ b/src/common/snippets/src/lowered/linear_ir.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Intel Corporation +// Copyright (C) 2023-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -104,6 +104,61 @@ ov::NodeVector LinearIR::get_ordered_ops(const std::shared_ptr& m) { return ov::topological_sort(nodes); } +namespace { +using NodeMap = std::unordered_map>; + +std::vector> clone_nodes(const std::vector>& nodes, + NodeMap& node_map) { + // for each node in topological order + auto sorted_nodes = topological_sort(nodes); + for (const auto& node : sorted_nodes) { + if (node_map.count(node.get()) == 0) { + // get (already) cloned arguments and clone the node + OutputVector cloned_args; + for (auto input : node->inputs()) { + ov::Output output = input.get_source_output(); + cloned_args.push_back(output.for_node(node_map.at(output.get_node()))); + } + std::vector> cloned_dependencies; + for (auto& dependency : node->get_control_dependencies()) { + std::shared_ptr& dependent = node_map.at(dependency.get()); + if (find(cloned_dependencies.begin(), cloned_dependencies.end(), dependent) == + cloned_dependencies.end()) { + cloned_dependencies.push_back(dependent); + } + } + auto cloned_node = node->copy_with_new_inputs(cloned_args, cloned_dependencies); + // There is a friendly name for this node so copy it + cloned_node->set_friendly_name(node->get_friendly_name()); + auto rt_info = node->get_rt_info(); + cloned_node->get_rt_info() = rt_info; + + for (auto output : node->outputs()) { + const auto& output_rt_info = output.get_rt_info(); + auto new_output = output.for_node(cloned_node); + new_output.get_rt_info() = output_rt_info; + } + + for (auto input : node->inputs()) { + const auto& output_rt_info = input.get_rt_info(); + auto new_input = cloned_node->input(input.get_index()); + new_input.get_rt_info() = output_rt_info; + } + + node_map[node.get()] = cloned_node; + } + } + + // create and return vector of cloned nodes + // order matches input vector (not necessarily topological) + std::vector> cloned_nodes; + for (const auto& node : nodes) { + cloned_nodes.push_back(node_map.at(node.get())); + } + return cloned_nodes; +} +} // namespace + LinearIR::container LinearIR::deep_copy_range(LinearIR::container::const_iterator begin, LinearIR::container::const_iterator end, ExressionMap& expression_map) { @@ -115,10 +170,8 @@ LinearIR::container LinearIR::deep_copy_range(LinearIR::container::const_iterato } // node_map and expr_map map original node pointer (expression) to a new pointer (expression) - ngraph::NodeMap node_map; - OPENVINO_SUPPRESS_DEPRECATED_START - ngraph::clone_nodes(original_nodes, node_map); - OPENVINO_SUPPRESS_DEPRECATED_END + NodeMap node_map; + clone_nodes(original_nodes, node_map); for (auto it = begin; it != end; it++) { const auto& expr = *it; diff --git a/src/core/include/ngraph/env_util.hpp b/src/core/include/ngraph/env_util.hpp deleted file mode 100644 index 501b0bd84fe..00000000000 --- a/src/core/include/ngraph/env_util.hpp +++ /dev/null @@ -1,55 +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 "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. -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. -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 -/// 1, 0, on, off, true, false -/// All values are case insensitive. -/// If the environment variable is not set the default_value is returned. -/// \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. -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/graph_util.hpp b/src/core/include/ngraph/graph_util.hpp deleted file mode 100644 index 098feac3dda..00000000000 --- a/src/core/include/ngraph/graph_util.hpp +++ /dev/null @@ -1,281 +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 -#include -#include -#include -#include -#include - -#include "openvino/core/graph_util.hpp" - -namespace ov { -namespace op { -namespace v0 { -class Parameter; -class Result; -} // namespace v0 -} // namespace op -} // namespace ov -namespace ngraph { - -namespace op { -namespace v0 { -using ov::op::v0::Parameter; -using ov::op::v0::Result; -} // namespace v0 -} // namespace op - -using ov::compare_constants; -using ov::replace_node; -using ov::replace_node_update_name; -using ov::replace_nodes; -using ov::replace_output_update_name; -using ov::topological_sort; -using ov::traverse_nodes; - -using NodeMap = std::unordered_map>; - -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 -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; - std::vector> result; - - for (auto& node : nodes) { - nodes_to_emit.insert(node.get()); - nodes_to_do.push(node.get()); - } - // NB: Some centos versions implement std::list::size() by counting elements - size_t nodes_remaining = nodes_to_emit.size(); - while (nodes_to_do.size() > 0 && nodes_remaining > 0) { - ov::Node* node = nodes_to_do.top(); - if (nodes_done.count(node) == 0) { - bool can_add = true; - size_t arg_count = node->get_input_size(); - for (size_t i = 0; i < arg_count; ++i) { - ov::Node* dep = node->get_input_node_ptr(arg_count - i - 1); - if (nodes_done.count(dep) == 0 && nodes_to_emit.count(node) != 0) { - can_add = false; - nodes_to_do.push(dep); - } - } - for (auto& depptr : node->get_control_dependencies()) { - ov::Node* dep = depptr.get(); - if (nodes_done.count(dep) == 0) { - can_add = false; - nodes_to_do.push(dep); - } - } - if (can_add) { - if (nodes_to_emit.count(node) != 0) { - result.push_back(node->shared_from_this()); - nodes_remaining--; - } - nodes_to_do.pop(); - nodes_done.insert(node); - } - } - - else { - nodes_to_do.pop(); - } - } - return result; -} - -template -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(); - } - OPENVINO_SUPPRESS_DEPRECATED_END -} - -// Check if all paths from X to a result go through 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") -OPENVINO_API -bool is_post_dominated(ov::Node* X, ov::Node* 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") -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 -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 -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); - -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); - -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); - -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); - -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); - -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); - -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, - bool ignore_output_duplicates = true); - -// Extract sub-graph computing the `results`. Stops backward traversal at either a Parameter -// node -// or a node that belongs to args -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); - -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` -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 -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); - -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); - -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); - -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`. -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`. -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. -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 - -using ngraph::replace_node; -using ngraph::replace_output_update_name; diff --git a/src/core/include/ngraph/util.hpp b/src/core/include/ngraph/util.hpp deleted file mode 100644 index 57e97de0bce..00000000000 --- a/src/core/include/ngraph/util.hpp +++ /dev/null @@ -1,337 +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 // llvm 8.1 gets confused about `malloc` otherwise -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ngraph/graph_util.hpp" -#include "ngraph/shape.hpp" -#include "openvino/core/axis_vector.hpp" -#include "openvino/core/enum_mask.hpp" -#include "openvino/core/type/element_type.hpp" -#include "openvino/core/type/element_type_traits.hpp" -#include "openvino/runtime/tensor.hpp" - -namespace ov { -class Node; -} -namespace ngraph { -using ov::EnumMask; -using ov::Node; -class stopwatch; -class Tensor; - -OPENVINO_SUPPRESS_DEPRECATED_START -template -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) { - if (count++ > 0) { - ss << sep; - } - ss << x; - } - return ss.str(); -} - -template -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(); -} - -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); -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); -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); -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); -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); -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 -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 OPENVINO_API OPENVINO_DEPRECATED("It is obsolete structure and will be removed soon") stopwatch { -public: - void start() { - if (m_active == false) { - m_total_count++; - m_active = true; - m_start_time = m_clock.now(); - } - } - - void stop() { - if (m_active == true) { - auto end_time = m_clock.now(); - m_last_time = end_time - m_start_time; - m_total_time += m_last_time; - m_active = false; - } - } - - size_t get_call_count() const; - size_t get_seconds() const; - size_t get_milliseconds() const; - size_t get_microseconds() const; - std::chrono::nanoseconds get_timer_value() const; - size_t get_nanoseconds() const; - - size_t get_total_seconds() const; - size_t get_total_milliseconds() const; - size_t get_total_microseconds() const; - size_t get_total_nanoseconds() const; - -private: - std::chrono::high_resolution_clock m_clock; - std::chrono::time_point m_start_time; - bool m_active = false; - std::chrono::nanoseconds m_total_time = std::chrono::high_resolution_clock::duration::zero(); - std::chrono::nanoseconds m_last_time = std::chrono::high_resolution_clock::duration::zero(); - size_t m_total_count = 0; -}; - -/// Parses a string containing a literal of the underlying type. -template -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; - - ss << s; - ss >> result; - - // Check that (1) parsing succeeded and (2) the entire string was used. - if (ss.fail() || ss.rdbuf()->in_avail() != 0) { - OPENVINO_THROW("Could not parse literal '" + s + "'"); - } - - return result; -} - -/// template specializations for float and double to handle INFINITY, -INFINITY -/// and NaN values. -template <> -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 <> -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 <> -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 <> -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 -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; - OPENVINO_SUPPRESS_DEPRECATED_END -} - -template -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 -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; -} - -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); -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*); - -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); - -/// \brief Function to query parsed version information of the version of ngraph which -/// contains this function. Version information strictly follows Semantic Versioning -/// http://semver.org -/// \param version The major part of the version -/// \param major Returns the major part of the version -/// \param minor Returns the minor part of the version -/// \param patch Returns the patch part of the version -/// \param extra Returns the extra part of the version. This includes everything following -/// the patch version number. -/// -/// \note Throws a runtime_error if there is an error during parsing -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 -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."); - } - - x = float_to_int_converter(x); - - double min_t = static_cast(std::numeric_limits::min()); - if (x < min_t) { - return std::numeric_limits::min(); - } - - double max_t = static_cast(std::numeric_limits::max()); - if (x > max_t) { - return std::numeric_limits::max(); - } - - return static_cast(x); -} -} // end namespace ngraph - -template -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"); - } - size_t element_count = ngraph::shape_size(tv->get_shape()); - size_t size = element_count * sizeof(T); - std::vector rc(element_count); - std::memcpy(rc.data(), tv->data(), size); - return rc; -} - -template -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]); - } - return result; -} - -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); - -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); - -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); -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/core/include/ngraph/validation_util.hpp b/src/core/include/ngraph/validation_util.hpp index ef9233ee72d..672b433ff1a 100644 --- a/src/core/include/ngraph/validation_util.hpp +++ b/src/core/include/ngraph/validation_util.hpp @@ -20,9 +20,12 @@ #include "openvino/op/constant.hpp" #include "openvino/op/util/attr_types.hpp" #include "openvino/op/util/variable_context.hpp" +#include "openvino/runtime/tensor.hpp" namespace ngraph { using ov::CoordinateDiff; +using ov::Shape; +using ov::Strides; using ov::op::v0::Constant; namespace element { @@ -34,7 +37,7 @@ OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 202 "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, +Strides conv_default_strides(const ov::Node* node, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape); @@ -42,7 +45,7 @@ OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 202 "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, +CoordinateDiff conv_default_padding(const ov::Node* node, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape); @@ -50,7 +53,7 @@ OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 202 "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, +ov::PartialShape infer_windowed_reduction_output_shape(const ov::Node* node, const ov::PartialShape& data_shape, const Strides& data_dilation, const CoordinateDiff& data_padding_below, @@ -64,7 +67,7 @@ ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, 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, +void validate_conv_params_spatial_dimensions(const ov::Node* node, const size_t num_spatial_dims, const ov::op::PadType auto_pad, Strides& strides, @@ -76,7 +79,7 @@ OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 202 "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, +ov::PartialShape infer_batched_pooling_forward(const ov::Node* node, const ov::PartialShape& data_batch_shape, const CoordinateDiff& data_padding_below, const CoordinateDiff& data_padding_above, @@ -90,7 +93,7 @@ OPENVINO_DEPRECATED("The nGraph API is deprecated and will be removed in the 202 "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, +ov::PartialShape infer_slice_shape(const ov::Node* node, const ov::PartialShape& input_shape, const std::vector& begin, const std::vector& end, diff --git a/src/core/include/openvino/op/constant.hpp b/src/core/include/openvino/op/constant.hpp index 222b006c094..658cf7ede02 100644 --- a/src/core/include/openvino/op/constant.hpp +++ b/src/core/include/openvino/op/constant.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -7,21 +7,14 @@ #include #include -#ifndef IN_OV_COMPONENT -# define IN_OV_COMPONENT -# define WAS_OV_LIBRARY_DEFINED_CONSTANT -#endif - -#include "ngraph/util.hpp" -#include "openvino/core/rtti.hpp" - -#ifdef WAS_OV_LIBRARY_DEFINED_CONSTANT -# undef IN_OV_COMPONENT -# undef WAS_OV_LIBRARY_DEFINED_CONSTANT -#endif +#include "openvino/core/axis_set.hpp" +#include "openvino/core/axis_vector.hpp" #include "openvino/core/coordinate_diff.hpp" +#include "openvino/core/graph_util.hpp" +#include "openvino/core/rtti.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/core/type/element_type_traits.hpp" +#include "openvino/op/op.hpp" namespace ov { diff --git a/src/core/src/env_util.cpp b/src/core/src/env_util.cpp deleted file mode 100644 index 91eb1dc8291..00000000000 --- a/src/core/src/env_util.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ngraph/env_util.hpp" - -#include "openvino/util/env_util.hpp" - -std::string ngraph::getenv_string(const char* env_var) { - return ov::util::getenv_string(env_var); -} - -int32_t ngraph::getenv_int(const char* env_var, int32_t default_value) { - return ov::util::getenv_int(env_var, default_value); -} - -bool ngraph::getenv_bool(const char* env_var, bool default_value) { - return ov::util::getenv_bool(env_var, default_value); -} diff --git a/src/core/src/graph_util.cpp b/src/core/src/graph_util.cpp index d66977c0d1c..ec24a5cba81 100644 --- a/src/core/src/graph_util.cpp +++ b/src/core/src/graph_util.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -340,346 +340,14 @@ void save_model(const std::shared_ptr& m, const std::string& ou manager.run_passes(cloned); } -} // namespace ov - -OPENVINO_SUPPRESS_DEPRECATED_START - -namespace ngraph { -ov::NodeVector find_common_args(std::shared_ptr node1, std::shared_ptr node2) { - std::unordered_set> node1_args; - - auto compute_node1_args = [&node1_args](const std::shared_ptr& node) { - node1_args.insert(node); - }; - - traverse_nodes({std::move(node1)}, compute_node1_args, ov::NodeVector{}); - - std::unordered_set> node2_args; - - auto compute_node2_args = [&node2_args](const std::shared_ptr& node) { - node2_args.insert(node); - }; - - traverse_nodes({std::move(node2)}, compute_node2_args, ov::NodeVector{}); - - ov::NodeVector common_args; - for (const auto& e : node1_args) { - if (node2_args.count(e) > 0) { - common_args.push_back(e); - } - } - - return common_args; -} - -// Check if all paths from X to a result go through Y -bool is_post_dominated(Node* X, Node* Y) { - std::unordered_set visited; - std::stack> stack; - stack.push(X); - - while (stack.size() > 0) { - ov::Node* curr = stack.top(); - visited.insert(curr); - if (ov::op::util::is_output(curr)) { - return false; - } - stack.pop(); - if (curr != Y) { - for (const auto& next : curr->get_users()) { - if (visited.count(next.get()) == 0) { - stack.push(next.get()); - } - } - } - } - return true; -} - -std::vector> clone_nodes(const std::vector>& nodes, - NodeMap& node_map) { - // for each node in topological order - auto sorted_nodes = topological_sort(nodes); - for (const auto& node : sorted_nodes) { - if (node_map.count(node.get()) == 0) { - // get (already) cloned arguments and clone the node - ov::OutputVector cloned_args; - for (auto input : node->inputs()) { - ov::Output output = input.get_source_output(); - cloned_args.push_back(output.for_node(node_map.at(output.get_node()))); - } - std::vector> cloned_dependencies; - for (auto& dependency : node->get_control_dependencies()) { - std::shared_ptr& dependent = node_map.at(dependency.get()); - if (find(cloned_dependencies.begin(), cloned_dependencies.end(), dependent) == - cloned_dependencies.end()) { - cloned_dependencies.push_back(dependent); - } - } - auto cloned_node = node->copy_with_new_inputs(cloned_args, cloned_dependencies); - // There is a friendly name for this node so copy it - cloned_node->set_friendly_name(node->get_friendly_name()); - auto rt_info = node->get_rt_info(); - cloned_node->get_rt_info() = rt_info; - - for (auto output : node->outputs()) { - const auto& output_rt_info = output.get_rt_info(); - auto new_output = output.for_node(cloned_node); - new_output.get_rt_info() = output_rt_info; - } - - for (auto input : node->inputs()) { - const auto& output_rt_info = input.get_rt_info(); - auto new_input = cloned_node->input(input.get_index()); - new_input.get_rt_info() = output_rt_info; - } - - node_map[node.get()] = cloned_node; - } - } - - // create and return vector of cloned nodes - // order matches input vector (not necessarily topological) - std::vector> cloned_nodes; - for (const auto& node : nodes) { - cloned_nodes.push_back(node_map.at(node.get())); - } - return cloned_nodes; -} - -std::list> clone_nodes(const std::vector>& nodes, - ov::RawNodeOutputMap& output_map) { - // for each node in topological order - auto sorted_nodes = topological_sort(nodes); - std::list> cloned_nodes; - for (const auto& node : sorted_nodes) { - auto node_outputs = node->outputs(); - for (const auto& value : node_outputs) { - if (output_map.count(value) == 0) { - // We need this node cloned - // get (already) cloned arguments and clone the node - ov::OutputVector cloned_args; - for (const auto& value : node->input_values()) { - cloned_args.push_back(output_map.at(value)); - } - ov::NodeVector cloned_dependencies; - for (auto& dependency : node->get_control_dependencies()) { - for (const auto& dependency_value : dependency->outputs()) { - std::shared_ptr dependent = output_map.at(dependency_value).get_node_shared_ptr(); - if (find(cloned_dependencies.begin(), cloned_dependencies.end(), dependent) == - cloned_dependencies.end()) { - cloned_dependencies.push_back(dependent); - } - } - } - auto cloned_node = node->copy_with_new_inputs(cloned_args, cloned_dependencies); - cloned_nodes.push_back(cloned_node); - // There is a friendly name for this node so copy it - cloned_node->set_friendly_name(node->get_friendly_name()); - auto rt_info = node->get_rt_info(); - cloned_node->get_rt_info() = rt_info; - for (const auto& cloned_value : cloned_node->outputs()) { - auto original_value = node_outputs.at(cloned_value.get_index()); - if (output_map.count(original_value) == 0) { - output_map[original_value] = cloned_value; - } - } - break; - } - } - } - return cloned_nodes; -} - -bool is_equal_to_const_value(const std::string& const_value, const ov::Output& reduce_constant) { - if (auto rc = ov::as_type_ptr(reduce_constant.get_node_shared_ptr())) { - return (rc->get_all_data_elements_bitwise_identical() && rc->convert_value_to_string(0) == const_value); - } else { - return false; - } -} - -// Insert result and parameter node between src_node and dst_node by splitting the graph -// -// Before: | After: -// (Device:0) (Device:1) | (Device:0) (Device:0) (Device:1) (Device:1) -// +-----+---+ +---+-----+ | +-----+---+ +---+-----+ +-----+---+ +---+-----+ -// | | | | | | | | | | | | | | | | | | | -// | | o +--[0]--> i | | | | | o +--[4]--> i | | | | o +--[8]--> i | | -// | | <--[1]--+ | | | | | <--[5]--+ | | | | <--[9]--+ | | -// | src +---+ +---+ dst | | | src +---+ +---+ res | | par +---+ +---+ dst | -// | | | | | | | | | | | | | -// | +------[2]------> | | | +------[6]------> | | +------[10]-----> | -// | <------[3]------+ | | | <------[7]------+ | | <------[11]-----+ | -// +-----+ +-----+ | +-----+ +-----+ +-----+ +-----+ -std::pair, std::shared_ptr> insert_result_parameter_split( - const std::shared_ptr& src_node, - const std::shared_ptr& dst_node) { - if (src_node->get_output_size() != 1) { - OPENVINO_THROW("Multiple output per op not supported in graph partition yet."); - } - - // Make parameter node - std::shared_ptr par_node = - std::make_shared(src_node->get_output_element_type(0), src_node->get_output_shape(0)); - - // Fix input / output among src, dst and par - std::vector> dst_inputs = get_inputs_from(*src_node, *dst_node); - OPENVINO_ASSERT(dst_inputs.size() == 1, - "insert_result_parameter_split encountered more than " - "one input between the source and destination nodes"); - auto& dst_input = dst_inputs[0]; - - std::vector> src_outputs = get_outputs_to(*src_node, *dst_node); - OPENVINO_ASSERT(src_outputs.size() == 1, - "insert_result_parameter_split encountered more than " - "one output between the source and destination nodes"); - auto& src_output = src_outputs[0]; - - // Remove [0] - src_output.remove_target_input(dst_input); - - // Remove [0] (again), add [8], remove [1], add [9] - dst_input.replace_source_output(par_node->output(0)); - - // Add res node - // Add [4], [5], [6], [7] - std::shared_ptr res_node = std::make_shared(src_node); - - return make_pair(res_node, par_node); -} - -// Insert unary node between two nodes like S->D => S->N->D -// Before: | After: -// +-----+---+ +---+-----+ | +-----+---+ +---+-----+---+ +---+-----+ -// | | | | | | | | | | | | | | | | | -// | | o +--[0]--> i | | | | | o +--[4]--> i | | o +--[8]--> i | | -// | | <--[1]--+ | | | | | <--[5]--+ | | <--[9]--+ | | -// | src +---+ +---+ dst | | | src +---+ +---+ new +---+ +---+ dst | -// | | | | | | | | | | | -// | +------[2]------> | | | +------[6]------> +------[10]-----> | -// | <------[3]------+ | | | <------[7]------+ <------[11]-----+ | -// +-----+ +-----+ | +-----+ +-----+ +-----+ -// | -// +-----+---+ +---+-----+ | -// | | | | | | | -// | | o +--[4]--> i | | | -// | | <--[5]--+ | | | -// | src +---+ +---+ new | | -// | | | | | -// | +------[6]------> | | -// | <------[7]------+ | | -// +-----+ +-----+ | -// -// This cannot be achieved by ngraph::replace_node(). -// With replace_node(), we could do: -// [ S S ] -// [ / \ | ] -// [ / \ => N ] -// [ / \ / \ ] -// [ D0 D1 D0 D1 ] -// -// But we want: -// [ S S ] -// [ / \ / \ ] -// [ / \ => N0 N1 ] -// [ / \ / \ ] -// [ D0 D1 D0 D1 ] -// -// Typically new_node is connected to src_node already. The reason we don't create `new_node` -// inside the function and return it (similar to ngraph::insert_result_parameter_split) is that -// we'll have to templatize its function to call new_node's constructor. -void insert_new_node_between(const std::shared_ptr& src_node, - const std::shared_ptr& dst_node, - const std::shared_ptr& new_node) { - // Fix input / output - std::vector> dst_inputs = get_inputs_from(*src_node, *dst_node); - OPENVINO_ASSERT(dst_inputs.size() == 1, - "insert_new_node_between encountered more than one " - "input between the source and destination nodes"); - auto& dst_input = dst_inputs[0]; - - std::vector> src_outputs = get_outputs_to(*src_node, *dst_node); - OPENVINO_ASSERT(src_outputs.size() == 1, - "insert_new_node_between encountered more than one " - "output between the source and destination nodes"); - auto& src_output = src_outputs[0]; - - src_output.remove_target_input(dst_input); // Remove [0] - dst_input.replace_source_output(new_node->output(0)); // Remove [0] (again), add [8], remove [1], add [9] -} - -std::shared_ptr make_zero(const ov::element::Type& element_type, const Shape& shape) { - auto zero = ov::op::v0::Constant::create(element_type, Shape{}, {0.0}); - if (shape.size() > 0) { - return std::make_shared( - zero, - ov::op::v0::Constant::create(ov::element::u64, Shape{shape.size()}, shape)); - } - return zero; -} - -std::shared_ptr make_constant_from_string(std::string val, - const ov::element::Type& element_type, - const Shape& shape) { - auto cvals = std::vector(shape_size(shape), val); - return std::make_shared(element_type, shape, cvals); -} - -bool is_zero(const ov::Output& reduce_constant) { - auto result_bool = is_equal_to_const_value("0", reduce_constant); - return result_bool; -} - -bool is_one(const ov::Output& reduce_constant) { - auto result_bool = is_equal_to_const_value("1", reduce_constant); - return result_bool; -} - -ov::NodeVector get_subgraph_outputs(const ov::NodeVector& nodes, - const ov::NodeVector& exclusions, - bool ignore_unused, - bool ignore_output_duplicates) { - std::set> exclusions_set(exclusions.begin(), exclusions.end()); - std::set> nodes_set(nodes.begin(), nodes.end()); - - ov::NodeVector outputs; - - for (const auto& n : nodes) { - if (exclusions_set.count(n) != 0) { - continue; - } - - for (const auto& u : n->get_users()) { - bool add_output = nodes_set.count(u) == 0 && (!ignore_unused || is_used(u.get())); - // check if output is already captured - add_output &= (ignore_output_duplicates || std::find(outputs.begin(), outputs.end(), n) == outputs.end()); - if (add_output) { - outputs.push_back(n); - } - } - } - return outputs; -} - -ov::NodeVector extract_subgraph(const ov::NodeVector& results, const ov::NodeVector& args) { - ov::NodeVector subgraph; - traverse_nodes( - results, - [&](const std::shared_ptr& n) { - subgraph.push_back(n); - }, - args); - return subgraph; -} - +bool is_used(Node* node); bool is_used(Node* node) { std::unordered_set instances_seen; std::stack> stack; stack.push(node); while (stack.size() > 0) { - ov::Node* n = stack.top(); + Node* n = stack.top(); if (instances_seen.count(n) == 0) { if (ov::op::util::is_output(n)) { return true; @@ -695,153 +363,4 @@ bool is_used(Node* node) { } return false; } - -size_t get_user_count(Node* node) { - size_t count = 0; - for (const auto& node_user : node->get_users()) { - count += is_used(node_user.get()); - } - return count; -} - -bool is_strided(const Strides& strides) { - return std::any_of(strides.begin(), strides.end(), [](size_t stride) { - return stride != 1; - }); -} - -bool is_valid_rank(const std::shared_ptr& node, std::vector valid_ranks) { - auto node_rank = node->get_shape().size(); - for (auto rank : valid_ranks) { - if (rank == node_rank) { - return true; - } - } - return false; -} - -void plot_graph(std::shared_ptr f, - const std::string& filename, - std::function& attributes)> attributes) { - ov::pass::Manager pass_manager; - pass_manager.register_pass(filename, attributes); - pass_manager.run_passes(std::move(f)); -} - -std::vector> get_inputs_from(Node& src, Node& dst) { - std::vector> result; - - for (auto& input : dst.inputs()) { - if (input.get_source_output().get_node() == &src) { - result.push_back(input); - } - } - - return result; -} - -std::vector> get_outputs_to(Node& src, Node& dst) { - std::vector> result; - - for (auto& output : src.outputs()) { - bool targets_dst = false; - - for (auto& input : output.get_target_inputs()) { - if (input.get_node() == &dst) { - targets_dst = true; - break; - } - } - - if (targets_dst) { - result.push_back(output); - } - } - - return result; -} - -static bool check_for_cycles_bkwd(const std::shared_ptr& node, - std::deque>& path, - std::unordered_set>& path_set, - ov::NodeVector& cycle_nodes) { - path.push_back(node); - path_set.insert(node); - for (size_t i = 0; i < node->inputs().size(); i++) { - auto arg = node->get_input_node_shared_ptr(i); - if (path_set.find(arg) != path_set.end()) { - for (const auto& it : path) { - cycle_nodes.push_back(it); - } - // last node - cycle_nodes.push_back(arg); - return true; - } - if (check_for_cycles_bkwd(arg, path, path_set, cycle_nodes)) { - return true; - } - } - path_set.erase(path.back()); - path.pop_back(); - return false; -} - -static bool check_for_cycles_fwd(const std::shared_ptr& node, - std::deque>& path, - std::unordered_set>& path_set, - ov::NodeVector& cycle_nodes) { - path.push_back(node); - path_set.insert(node); - for (auto& arg : node->get_users()) { - if (path_set.find(arg) != path_set.end()) { - for (const auto& it : path) { - cycle_nodes.push_back(it); - } - // last node - cycle_nodes.push_back(arg); - return true; - } - if (check_for_cycles_fwd(arg, path, path_set, cycle_nodes)) { - return true; - } - } - path_set.erase(path.back()); - path.pop_back(); - return false; -} - -bool check_for_cycles(const ov::Model* func, ov::NodeVector& cycle_nodes, bool& is_bkwd_cycle) { - for (const auto& res : func->get_results()) { - std::deque> path; - // mirror of path stack for faster cycle check - std::unordered_set> path_set; - if (check_for_cycles_bkwd(res, path, path_set, cycle_nodes)) { - is_bkwd_cycle = true; - return true; - } - } - - for (const auto& res : func->get_sinks()) { - std::deque> path; - // mirror of path stack for faster cycle check - std::unordered_set> path_set; - if (check_for_cycles_bkwd(res, path, path_set, cycle_nodes)) { - is_bkwd_cycle = true; - return true; - } - } - - for (const auto& param : func->get_parameters()) { - std::deque> path; - // mirror of path stack for faster cycle check - std::unordered_set> path_set; - if (check_for_cycles_fwd(param, path, path_set, cycle_nodes)) { - is_bkwd_cycle = false; - return true; - } - } - // no cycles - return false; -} - -} // namespace ngraph +} // namespace ov diff --git a/src/core/src/model.cpp b/src/core/src/model.cpp index b0d1ad56f93..334e9fe2241 100644 --- a/src/core/src/model.cpp +++ b/src/core/src/model.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,6 +13,7 @@ #include "layout_utils.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/except.hpp" +#include "openvino/core/graph_util.hpp" #include "openvino/core/meta_data.hpp" #include "openvino/core/partial_shape.hpp" #include "openvino/op/parameter.hpp" diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp index 80ac8cdeba8..84ad0004848 100644 --- a/src/core/src/node.cpp +++ b/src/core/src/node.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -15,6 +15,7 @@ #include "openvino/core/descriptor/input.hpp" #include "openvino/core/rt_info.hpp" #include "openvino/core/shape_util.hpp" +#include "openvino/op/util/op_types.hpp" #include "openvino/pass/constant_folding.hpp" #include "openvino/pass/pattern/matcher.hpp" #include "shape_validation.hpp" @@ -513,16 +514,18 @@ bool ov::Node::has_same_type(std::shared_ptr node) const { return true; } +namespace ov { +bool is_used(Node* node); +} + ov::NodeVector ov::Node::get_users(bool check_is_used) const { NodeVector result; 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)) { + if (!check_is_used || is_used(input_node)) { result.push_back(input_node->shared_from_this()); } - OPENVINO_SUPPRESS_DEPRECATED_END } } return result; diff --git a/src/core/src/pass/manager.cpp b/src/core/src/pass/manager.cpp index fd25ea1e803..69363fe72f7 100644 --- a/src/core/src/pass/manager.cpp +++ b/src/core/src/pass/manager.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,7 +12,6 @@ #include #include "itt.hpp" -#include "ngraph/util.hpp" #include "openvino/pass/graph_rewrite.hpp" #include "openvino/pass/visualize_tree.hpp" #include "openvino/util/env_util.hpp" @@ -55,6 +54,44 @@ void ov::pass::Manager::set_per_pass_validation(bool new_state) { m_per_pass_validation = new_state; } +namespace { +class stopwatch { +public: + void start() { + if (m_active == false) { + m_active = true; + m_start_time = m_clock.now(); + } + } + + void stop() { + if (m_active == true) { + auto end_time = m_clock.now(); + m_last_time = end_time - m_start_time; + m_active = false; + } + } + + std::chrono::nanoseconds get_timer_value() const { + if (m_active) { + return (m_clock.now() - m_start_time); + } else { + return m_last_time; + } + } + + size_t get_milliseconds() const { + return std::chrono::duration_cast(get_timer_value()).count(); + } + +private: + std::chrono::high_resolution_clock m_clock; + std::chrono::time_point m_start_time; + bool m_active = false; + std::chrono::nanoseconds m_last_time = std::chrono::high_resolution_clock::duration::zero(); +}; +} // namespace + bool ov::pass::Manager::run_passes(shared_ptr func) { OPENVINO_SUPPRESS_DEPRECATED_START OV_ITT_SCOPED_TASK(ov::itt::domains::core, "pass::Manager::run_passes"); @@ -63,8 +100,8 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { ov::util::getenv_bool("NGRAPH_PROFILE_PASS_ENABLE") || ov::util::getenv_bool("OV_PROFILE_PASS_ENABLE"); size_t index = 0; - ngraph::stopwatch pass_timer; - ngraph::stopwatch overall_timer; + stopwatch pass_timer; + stopwatch overall_timer; overall_timer.start(); bool pass_applied = false; bool function_changed = false; diff --git a/src/core/src/pattern/matcher.cpp b/src/core/src/pattern/matcher.cpp index b38cb7acdbb..ab14a875a37 100644 --- a/src/core/src/pattern/matcher.cpp +++ b/src/core/src/pattern/matcher.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,6 +12,8 @@ #include "openvino/util/log.hpp" namespace ov { +bool is_used(Node* node); + namespace pass { namespace pattern { MatcherState::MatcherState(Matcher* matcher) @@ -83,8 +85,30 @@ void Matcher::capture(const std::set& static_nodes) { } } } + +namespace { +ov::NodeVector get_subgraph_outputs(const NodeVector& nodes, const NodeVector& exclusions, bool ignore_unused) { + const std::set> exclusions_set(exclusions.begin(), exclusions.end()); + const std::set> nodes_set(nodes.begin(), nodes.end()); + + NodeVector outputs; + + for (const auto& n : nodes) { + if (exclusions_set.count(n) != 0) + continue; + + for (const auto& u : n->get_users()) { + bool add_output = nodes_set.count(u) == 0 && (!ignore_unused || is_used(u.get())); + if (add_output) { + outputs.push_back(n); + } + } + } + return outputs; +} +} // namespace + bool Matcher::is_contained_match(const NodeVector& exclusions, bool ignore_unused) { - OPENVINO_SUPPRESS_DEPRECATED_START if (exclusions.empty()) { NodeVector label_exclusions; for (const auto& entry : m_pattern_map) { @@ -93,11 +117,10 @@ bool Matcher::is_contained_match(const NodeVector& exclusions, bool ignore_unuse label_exclusions.push_back(entry.second.get_node_shared_ptr()); } } - return ngraph::get_subgraph_outputs(get_matched_nodes(), label_exclusions, ignore_unused).size() < 2; + return get_subgraph_outputs(get_matched_nodes(), label_exclusions, ignore_unused).size() < 2; } - return ngraph::get_subgraph_outputs(get_matched_nodes(), exclusions).size() < 2; - OPENVINO_SUPPRESS_DEPRECATED_END + return get_subgraph_outputs(get_matched_nodes(), exclusions, false).size() < 2; } bool Matcher::match_value(const ov::Output& pattern_value, const ov::Output& graph_value) { diff --git a/src/core/src/specialize_function.cpp b/src/core/src/specialize_function.cpp index c309ab100d8..d352b7635cb 100644 --- a/src/core/src/specialize_function.cpp +++ b/src/core/src/specialize_function.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -26,7 +26,7 @@ std::shared_ptr ngraph::specialize_function(std::shared_ptrget_parameters().size() == parameter_element_types.size()); OPENVINO_ASSERT(f->get_parameters().size() == parameter_values.size()); - NodeMap m; + std::unordered_map> m; for (size_t i = 0; i < parameter_shapes.size(); i++) { OPENVINO_ASSERT(f->get_parameters()[i]->get_element_type().is_dynamic() || @@ -58,7 +58,7 @@ std::shared_ptr ngraph::specialize_function(std::shared_ptrget_control_dependencies()) { - std::shared_ptr dependent = m.at(dependency.get()); + std::shared_ptr dependent = m.at(dependency.get()); if (find(cloned_dependencies.begin(), cloned_dependencies.end(), dependent) == cloned_dependencies.end()) { cloned_dependencies.push_back(dependent); } diff --git a/src/core/src/util.cpp b/src/core/src/util.cpp deleted file mode 100644 index 17b2b60ebf5..00000000000 --- a/src/core/src/util.cpp +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ngraph/util.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "openvino/util/common_util.hpp" -#include "openvino/util/log.hpp" - -OPENVINO_SUPPRESS_DEPRECATED_START - -namespace ngraph { -void dump(std::ostream& out, const void* _data, size_t _size) { - auto flags = out.flags(); - const uint8_t* data = reinterpret_cast(_data); - size_t len = _size; - size_t index = 0; - while (index < len) { - out << std::hex << std::setw(8) << std::setfill('0') << index; - for (int i = 0; i < 8; i++) { - if (index + i < len) { - out << " " << std::hex << std::setw(2) << std::setfill('0') << static_cast(data[i]); - } else { - out << " "; - } - } - out << " "; - for (int i = 8; i < 16; i++) { - if (index + i < len) { - out << " " << std::hex << std::setw(2) << std::setfill('0') << static_cast(data[i]); - } else { - out << " "; - } - } - out << " "; - for (int i = 0; i < 16; i++) { - char ch = (index + i < len ? data[i] : ' '); - out << ((ch < 32) ? '.' : ch); - } - out << "\n"; - data += 16; - index += 16; - } - out.flags(flags); -} - -std::string to_lower(const std::string& s) { - return ov::util::to_lower(s); -} - -std::string to_upper(const std::string& s) { - return ov::util::to_upper(s); -} - -std::string trim(const std::string& s) { - return ov::util::trim(s); -} - -std::vector split(const std::string& src, char delimiter, bool do_trim) { - return ov::util::split(src, delimiter, do_trim); -} - -size_t hash_combine(const std::vector& list) { - return ov::util::hash_combine(list); -} - -void* ngraph_malloc(size_t size) { - auto ptr = malloc(size); - if (size != 0 && !ptr) { - OPENVINO_ERR << "malloc failed to allocate memory of size " << size; - throw std::bad_alloc(); - } - return ptr; -} - -void ngraph_free(void* ptr) { - if (ptr) { - free(ptr); - } -} - -size_t round_up(size_t size, size_t alignment) { - if (alignment == 0) { - return size; - } - - size_t remainder = size % alignment; - if (remainder == 0) { - return size; - } - - return size + alignment - remainder; -} - -size_t stopwatch::get_call_count() const { - return m_total_count; -} - -size_t stopwatch::get_seconds() const { - return std::chrono::duration_cast(get_timer_value()).count(); -} - -size_t stopwatch::get_milliseconds() const { - return std::chrono::duration_cast(get_timer_value()).count(); -} - -size_t stopwatch::get_microseconds() const { - return std::chrono::duration_cast(get_timer_value()).count(); -} - -size_t stopwatch::get_nanoseconds() const { - return get_timer_value().count(); -} - -std::chrono::nanoseconds stopwatch::get_timer_value() const { - if (m_active) { - return (m_clock.now() - m_start_time); - } else { - return m_last_time; - } -} - -size_t stopwatch::get_total_seconds() const { - return std::chrono::duration_cast(m_total_time).count(); -} - -size_t stopwatch::get_total_milliseconds() const { - return std::chrono::duration_cast(m_total_time).count(); -} - -size_t stopwatch::get_total_microseconds() const { - return std::chrono::duration_cast(m_total_time).count(); -} - -size_t stopwatch::get_total_nanoseconds() const { - return m_total_time.count(); -} - -template <> -float parse_string(const std::string& s) { - const char* tmp = s.c_str(); - char* end; - float result = strtof(tmp, &end); - if (*end != 0) { - throw std::runtime_error("Could not parse literal '" + s + "'"); - } - return result; -} - -template <> -double parse_string(const std::string& s) { - const char* tmp = s.c_str(); - char* end; - double result = strtod(tmp, &end); - if (*end != 0) { - throw std::runtime_error("Could not parse literal '" + s + "'"); - } - return result; -} - -template <> -int8_t parse_string(const std::string& s) { - char* err; - int8_t result = static_cast(strtol(s.c_str(), &err, 10)); - - // Check that (1) parsing succeeded and (2) the entire string was used. - if (*err != 0) { - throw std::runtime_error("Could not parse literal '" + s + "'"); - } - - return result; -} - -template <> -uint8_t parse_string(const std::string& s) { - char* err; - int8_t result = static_cast(strtol(s.c_str(), &err, 10)); - - // Check that (1) parsing succeeded and (2) the entire string was used. - if (*err != 0) { - throw std::runtime_error("Could not parse literal '" + s + "'"); - } - - return result; -} - -void parse_version_string(std::string version, size_t& major, size_t& minor, size_t& patch, std::string& extra) { - // Since regex is broken in gcc 4.8 I will just manually parse the version string - // Version strings look like `0.25.0-rc.0+7c32240` or `v0.25.0-rc.0+7c32240` - size_t start; - size_t end; - extra = ""; - start = (version[0] == 'v' ? 1 : 0); - end = version.find_first_of('.', start); - std::string major_str = version.substr(start, end - start); - start = end + 1; - - end = version.find_first_of('.', start); - std::string minor_str = version.substr(start, end - start); - start = end + 1; - - end = version.find_first_of("-+", start); - std::string patch_str = version.substr(start, end - start); - start = end; - - if (start != std::string::npos) { - extra = version.substr(start); - } - - size_t err; - bool error = false; - try { - major = stoi(major_str, &err); - if (err != major_str.size()) { - error = true; - } - minor = stoi(minor_str, &err); - if (err != minor_str.size()) { - error = true; - } - patch = stoi(patch_str, &err); - if (err != patch_str.size()) { - error = true; - } - } catch (...) { - error = true; - } - if (error) { - OPENVINO_THROW("Error parsing version string '", version, "'"); - } -} -} // namespace ngraph - -std::vector read_float_vector(std::shared_ptr tv) { - std::vector float_vec; - ov::element::Type element_type = tv->get_element_type(); - - if (element_type == ov::element::boolean) { - std::vector vec = read_vector(tv); - // Changed from vector ctor to explicit for loop to add static_cast - // This silences MSVC warnings - for (char value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::bf16) { - std::vector vec = read_vector(tv); - float_vec = ov::bfloat16::to_float_vector(vec); - } else if (element_type == ov::element::f16) { - std::vector vec = read_vector(tv); - for (ov::float16 value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::f32) { - std::vector vec = read_vector(tv); - for (float value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::f64) { - std::vector vec = read_vector(tv); - for (double value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i8) { - std::vector vec = read_vector(tv); - for (int8_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i16) { - std::vector vec = read_vector(tv); - for (int16_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i32) { - std::vector vec = read_vector(tv); - for (int32_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i64) { - std::vector vec = read_vector(tv); - for (int64_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u8) { - std::vector vec = read_vector(tv); - for (uint8_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u16) { - std::vector vec = read_vector(tv); - for (uint16_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u32) { - std::vector vec = read_vector(tv); - for (uint32_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u64) { - std::vector vec = read_vector(tv); - for (uint64_t value : vec) { - float_vec.push_back(static_cast(value)); - } - } else { - OPENVINO_THROW("Unsupported OpenVINO element type."); - } - - return float_vec; -} - -std::vector read_index_vector(std::shared_ptr tv) { - std::vector index_vec; - ov::element::Type element_type = tv->get_element_type(); - - if (element_type == ov::element::boolean) { - std::vector vec = read_vector(tv); - // Changed from vector ctor to explicit for loop to add static_cast - // This silences MSVC warnings - for (char value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::bf16) { - std::vector vec = read_vector(tv); - std::vector float_vec = ov::bfloat16::to_float_vector(vec); - for (float value : float_vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::f16) { - std::vector vec = read_vector(tv); - for (ov::float16 value : vec) { - index_vec.push_back(static_cast(static_cast(value))); - } - } else if (element_type == ov::element::f32) { - std::vector vec = read_vector(tv); - for (float value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::f64) { - std::vector vec = read_vector(tv); - for (double value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i8) { - std::vector vec = read_vector(tv); - for (int8_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i16) { - std::vector vec = read_vector(tv); - for (int16_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i32) { - std::vector vec = read_vector(tv); - for (int32_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::i64) { - index_vec = read_vector(tv); - } else if (element_type == ov::element::u8) { - std::vector vec = read_vector(tv); - for (uint8_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u16) { - std::vector vec = read_vector(tv); - for (uint16_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u32) { - std::vector vec = read_vector(tv); - for (uint32_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else if (element_type == ov::element::u64) { - std::vector vec = read_vector(tv); - for (uint64_t value : vec) { - index_vec.push_back(static_cast(value)); - } - } else { - OPENVINO_THROW("Unsupported OpenVINO element type."); - } - - return index_vec; -} diff --git a/src/core/src/validation_util.cpp b/src/core/src/validation_util.cpp index 3137ab1de20..13cccab1d3e 100644 --- a/src/core/src/validation_util.cpp +++ b/src/core/src/validation_util.cpp @@ -14,6 +14,7 @@ #include "openvino/op/gather.hpp" #include "openvino/op/negative.hpp" #include "openvino/op/ops.hpp" +#include "openvino/util/common_util.hpp" #include "sequnce_generator.hpp" #include "validation_util.hpp" @@ -28,7 +29,7 @@ using ov::op::v0::Negative; } // namespace v0 } // namespace op -Strides conv_default_strides(const Node* /* node */, +Strides conv_default_strides(const ov::Node* /* node */, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape) { size_t rank; @@ -44,7 +45,7 @@ Strides conv_default_strides(const Node* /* node */, return Strides(rank, 1); } -CoordinateDiff conv_default_padding(const Node* /* node */, +CoordinateDiff conv_default_padding(const ov::Node* /* node */, const ov::PartialShape& data_batch_shape, const ov::PartialShape& filters_shape) { size_t rank; @@ -67,7 +68,7 @@ CoordinateDiff conv_default_padding(const Node* /* node */, // TODO(amprocte): The messages here would be a bit friendlier if we didn't say "after // padding/after dilation" for cases where there is actually no padding/dilation. // -ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, +ov::PartialShape infer_windowed_reduction_output_shape(const ov::Node* node, const ov::PartialShape& data_shape, const Strides& data_dilation, const CoordinateDiff& data_padding_below, @@ -182,10 +183,10 @@ ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, "."); if (ceil_mode) { - output_shape[i] = - ceil_div(static_cast(data_padded_dilated_dim) - static_cast(window_dilated_dim), - window_strides[i]) + - 1; + output_shape[i] = ov::util::ceil_div(static_cast(data_padded_dilated_dim) - + static_cast(window_dilated_dim), + window_strides[i]) + + 1; } else { output_shape[i] = ((static_cast(data_padded_dilated_dim) - static_cast(window_dilated_dim)) / @@ -199,7 +200,7 @@ ov::PartialShape infer_windowed_reduction_output_shape(const Node* node, return output_shape; } -void validate_conv_params_spatial_dimensions(const Node* node, +void validate_conv_params_spatial_dimensions(const ov::Node* node, const size_t num_spatial_dims, const ov::op::PadType auto_pad, Strides& strides, @@ -232,7 +233,7 @@ void validate_conv_params_spatial_dimensions(const Node* node, // // Infers the output batch shape and element type for batched pooling fprop. // -ov::PartialShape infer_batched_pooling_forward(const Node* node, +ov::PartialShape infer_batched_pooling_forward(const ov::Node* node, const ov::PartialShape& data_batch_shape, const CoordinateDiff& data_padding_below, const CoordinateDiff& data_padding_above, @@ -322,7 +323,7 @@ ov::PartialShape infer_batched_pooling_forward(const Node* node, return data_batch_output_shape; } -ov::PartialShape infer_slice_shape(const Node* node, +ov::PartialShape infer_slice_shape(const ov::Node* node, const ov::PartialShape& input_shape, const std::vector& begin, const std::vector& end, @@ -603,7 +604,7 @@ int64_t ov::util::clip(const int64_t& value, const int64_t& min, const int64_t& return std::min(std::max(value, min), max); }; -std::shared_ptr ov::util::constantfold_subgraph(const ov::Output& subgraph_sink) { +std::shared_ptr ov::util::constantfold_subgraph(const ov::Output& subgraph_sink) { if (const auto& c = ov::as_type_ptr(subgraph_sink.get_node_shared_ptr())) return c; @@ -640,7 +641,7 @@ namespace ov { namespace util { using ov::op::v0::Constant; -std::shared_ptr get_constant_from_source(const ov::Output& source) { +std::shared_ptr get_constant_from_source(const ov::Output& source) { if (const auto& c = ov::as_type_ptr(source.get_node_shared_ptr())) { return c; } else if (has_and_set_equal_bounds(source)) { @@ -743,7 +744,7 @@ std::vector get_tensors_partial_shapes(const TensorVector& ten return shapes; } -std::vector get_node_input_partial_shapes(const Node& node) { +std::vector get_node_input_partial_shapes(const ov::Node& node) { std::vector shapes; shapes.reserve(node.get_input_size()); for (size_t i = 0; i < node.get_input_size(); ++i) { @@ -758,7 +759,7 @@ bool is_rank_compatible_any_of(const Rank& r, std::initializer_list others }); } -bool evaluate_as_partial_shape(const ov::Output& output, ov::PartialShape& pshape) { +bool evaluate_as_partial_shape(const ov::Output& output, ov::PartialShape& pshape) { Tensor lb, ub; std::tie(lb, ub) = evaluate_both_bounds(output); bool shape_defined = false; @@ -791,7 +792,7 @@ bool evaluate_as_partial_shape(const ov::Output& output, ov::PartialShape& return shape_defined; } -bool default_label_evaluator(const Node* node, TensorLabelVector& output_labels) { +bool default_label_evaluator(const ov::Node* node, TensorLabelVector& output_labels) { return default_label_evaluator(node, {0}, output_labels); } @@ -820,7 +821,7 @@ std::vector normalize_axes(const std::string& node_description, return new_axes; } -void normalize_axes(const Node* node, const int64_t& tensor_rank, std::vector& axes) { +void normalize_axes(const ov::Node* node, const int64_t& tensor_rank, std::vector& axes) { const auto axis_checker = cmp::Between(-tensor_rank, tensor_rank ? (tensor_rank - 1) : 0); const auto invalid_axis = std::find_if_not(axes.cbegin(), axes.cend(), axis_checker); NODE_VALIDATION_CHECK(node, @@ -829,7 +830,7 @@ void normalize_axes(const Node* node, const int64_t& tensor_rank, std::vectordescription(), axis, tensor_rank); } @@ -853,7 +854,7 @@ int64_t normalize_axis(const std::string& node_description, std::int64_t axis, c tensor_rank_value ? (tensor_rank_value - 1) : 0); } -int64_t normalize_axis(const Node* node, +int64_t normalize_axis(const ov::Node* node, std::int64_t axis, std::uint64_t tensor_rank, std::int64_t axis_range_min, diff --git a/src/core/tests/build_graph.cpp b/src/core/tests/build_graph.cpp index c6714fcb715..60d19fdb1f9 100644 --- a/src/core/tests/build_graph.cpp +++ b/src/core/tests/build_graph.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,7 +9,6 @@ #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/test_tools.hpp" #include "common_test_utils/type_prop.hpp" -#include "ngraph/graph_util.hpp" #include "openvino/core/except.hpp" #include "openvino/op/abs.hpp" #include "openvino/op/acos.hpp" @@ -128,9 +127,8 @@ TEST(build_graph, no_arg_construction) { add1->set_argument(0, acos0); add1->set_argument(1, abs0); NodeVector ops{arg0, arg1, add0, abs0, acos0, add1}; - OPENVINO_SUPPRESS_DEPRECATED_START - ngraph::validate_nodes_and_infer_types(ops); - OPENVINO_SUPPRESS_DEPRECATED_END + for (const auto& op : ov::topological_sort(ops)) + op->revalidate_and_infer_types(); ASSERT_EQ(add1->get_output_shape(0), Shape{7}); } diff --git a/src/core/tests/pattern.cpp b/src/core/tests/pattern.cpp index df1c81fcce1..fdd9a783f91 100644 --- a/src/core/tests/pattern.cpp +++ b/src/core/tests/pattern.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -588,14 +588,21 @@ TEST(pattern, test_sort) { } TEST(pattern, label_on_skip) { + const auto zero = std::string{"0"}; + const auto is_zero = [&zero](const Output& node) { + if (const auto c = as_type_ptr(node.get_node_shared_ptr())) { + return (c->get_all_data_elements_bitwise_identical() && c->convert_value_to_string(0) == zero); + } else { + return false; + } + }; + Shape shape{2, 2}; auto a = make_shared(element::i32, shape); auto b = make_shared(element::i32, Shape{}); - OPENVINO_SUPPRESS_DEPRECATED_START - auto iconst = ngraph::make_zero(element::i32, Shape{}); + auto iconst = op::v0::Constant::create(element::i32, Shape{}, {0.0f}); auto label = std::make_shared(iconst); - auto const_label = std::make_shared(iconst, ngraph::is_zero, NodeVector{iconst}); - OPENVINO_SUPPRESS_DEPRECATED_END + auto const_label = std::make_shared(iconst, is_zero, NodeVector{iconst}); auto bcst_pred = [](std::shared_ptr n) { return ov::as_type_ptr(n) != nullptr; diff --git a/src/core/tests/specialize_function.cpp b/src/core/tests/specialize_function.cpp index dbea227cc74..a17ed00cee7 100644 --- a/src/core/tests/specialize_function.cpp +++ b/src/core/tests/specialize_function.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // diff --git a/src/core/tests/type_prop/batch_to_space.cpp b/src/core/tests/type_prop/batch_to_space.cpp index df529d1853f..44383157996 100644 --- a/src/core/tests/type_prop/batch_to_space.cpp +++ b/src/core/tests/type_prop/batch_to_space.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,9 +9,9 @@ #include #include "common_test_utils/type_prop.hpp" -#include "ngraph/util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/space_to_batch.hpp" +#include "openvino/util/common_util.hpp" using namespace std; using namespace testing; @@ -377,7 +377,7 @@ TEST(type_prop, batch_to_space_output_dynamic_shape_5D_when_batch_is_dynamic) { auto batch_to_space = make_shared(data, block_shape, crops_begin, crops_end); EXPECT_EQ(batch_to_space->get_output_partial_shape(0), - (ov::PartialShape{{ngraph::ceil_div(959, (6 * 5 * 16)), 962 / (6 * 5 * 16)}, + (ov::PartialShape{{ov::util::ceil_div(959, (6 * 5 * 16)), 962 / (6 * 5 * 16)}, {2 * 6 - 2 - 2, 34 * 6 - 2 - 2}, {9 * 5 - 1, 21 * 5 - 1}, {100, 162}, diff --git a/src/core/tests/type_prop/depth_to_space.cpp b/src/core/tests/type_prop/depth_to_space.cpp index 5562094caba..e656bbe0a9b 100644 --- a/src/core/tests/type_prop/depth_to_space.cpp +++ b/src/core/tests/type_prop/depth_to_space.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -7,7 +7,7 @@ #include #include "common_test_utils/type_prop.hpp" -#include "ngraph/util.hpp" +#include "openvino/util/common_util.hpp" using namespace std; using namespace ov; @@ -49,7 +49,7 @@ TEST(type_prop, depth_to_space_output_dynamicshape_block_first_5D_when_depth_is_ ASSERT_EQ(depth_to_space->get_output_partial_shape(0), (PartialShape{{2, 10}, - {ngraph::ceil_div(81, 27), 82 / 27}, + {ov::util::ceil_div(81, 27), 82 / 27}, {3 * 3, 7 * 3}, {423 * 3, 3000 * 3}, {235 * 3, 1345 * 3}})); 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 5c04efe0576..31c898b8a75 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // diff --git a/src/frontends/onnx/frontend/src/core/node.cpp b/src/frontends/onnx/frontend/src/core/node.cpp index ff87ff9cc36..3188e798528 100644 --- a/src/frontends/onnx/frontend/src/core/node.cpp +++ b/src/frontends/onnx/frontend/src/core/node.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -231,7 +231,7 @@ template std::shared_ptr Node::Impl::get_attribute_as_constant(const std::string& name) const { const auto value = get_attribute_value(name); const ov::element::Type type = ov::element::from(); - return std::make_shared(type, Shape{}, value); + return std::make_shared(type, ov::Shape{}, value); } template @@ -239,7 +239,7 @@ std::shared_ptr Node::Impl::get_attribute_as_constant(cons T default_value) const { const auto value = get_attribute_value(name, default_value); const ov::element::Type type = ov::element::from(); - return std::make_shared(type, Shape{}, value); + return std::make_shared(type, ov::Shape{}, value); } template @@ -248,7 +248,7 @@ std::shared_ptr Node::Impl::get_attribute_as_constant(cons ov::element::Type type) const { const auto value = get_attribute_value(name, default_value); return std::make_shared(type == ov::element::undefined ? ov::element::from() : type, - Shape{}, + ov::Shape{}, value); } @@ -257,7 +257,7 @@ std::shared_ptr Node::Impl::get_attribute_as_constant(cons ov::element::Type type) const { const auto value = get_attribute_value(name); return std::make_shared(type == ov::element::undefined ? ov::element::from() : type, - Shape{}, + ov::Shape{}, value); } diff --git a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp index 55c3c792cf5..7044d63ae5f 100644 --- a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp +++ b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -23,11 +23,11 @@ public: : m_values{sparse_tensor.values(), model_dir, mmap_cache}, m_indices{sparse_tensor.indices(), model_dir, mmap_cache}, m_shape{std::begin(sparse_tensor.dims()), std::end(sparse_tensor.dims())} { - if (m_shape == Shape{0}) { + if (m_shape == ov::Shape{0}) { // It's possible to construct a sparse tensor in ONNX with "dims: 0" property // Such tensor contains a scalar. This results in a Shape{0} stored in m_shape. // In OpenVINO a scalar is represented with Shape{} and thus this replacement. - m_shape = Shape{}; + m_shape = ov::Shape{}; } } @@ -37,7 +37,7 @@ public: SparseTensor& operator=(const SparseTensor&) = delete; SparseTensor& operator=(SparseTensor&&) = delete; - const Shape& get_shape() const { + const ov::Shape& get_shape() const { return m_shape; } @@ -60,7 +60,7 @@ public: private: Tensor m_values; Tensor m_indices; - Shape m_shape; + ov::Shape m_shape; }; inline std::ostream& operator<<(std::ostream& outs, const SparseTensor& tensor) { diff --git a/src/frontends/onnx/frontend/src/core/tensor.hpp b/src/frontends/onnx/frontend/src/core/tensor.hpp index 502211cb03f..e780b8b1024 100644 --- a/src/frontends/onnx/frontend/src/core/tensor.hpp +++ b/src/frontends/onnx/frontend/src/core/tensor.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -92,11 +92,11 @@ public: m_shape{std::begin(tensor.dims()), std::end(tensor.dims())}, m_model_dir{model_dir}, m_mmap_cache{mmap_cache} { - if (m_shape == Shape{0}) { + if (m_shape == ov::Shape{0}) { // It's possible to construct a tensor in ONNX with "dims: 0" property // Such tensor contains a scalar. This results in a Shape{0} stored in m_shape. // In OpenVINO a scalar is represented with Shape{} and thus this replacement. - m_shape = Shape{}; + m_shape = ov::Shape{}; } } @@ -106,7 +106,7 @@ public: Tensor& operator=(const Tensor&) = delete; Tensor& operator=(Tensor&&) = delete; - const Shape& get_shape() const { + const ov::Shape& get_shape() const { return m_shape; } template @@ -331,7 +331,7 @@ private: } const ONNX_NAMESPACE::TensorProto* m_tensor_proto; - Shape m_shape; + ov::Shape m_shape; std::string m_model_dir; detail::MappedMemoryHandles m_mmap_cache; }; diff --git a/src/frontends/onnx/frontend/src/onnx_framework_node.cpp b/src/frontends/onnx/frontend/src/onnx_framework_node.cpp index 989bd69c688..5af271e2794 100644 --- a/src/frontends/onnx/frontend/src/onnx_framework_node.cpp +++ b/src/frontends/onnx/frontend/src/onnx_framework_node.cpp @@ -1,5 +1,5 @@ //***************************************************************************** -// Copyright 2017-2022 Intel Corporation +// Copyright (C) 2017-2024 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,15 +18,15 @@ namespace ngraph { namespace frontend { -std::shared_ptr ONNXFrameworkNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { +std::shared_ptr ONNXFrameworkNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { return std::make_shared(m_node, inputs); } -std::shared_ptr ONNXSubgraphFrameworkNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { +std::shared_ptr ONNXSubgraphFrameworkNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { return std::make_shared(m_node, m_models, inputs); } -std::shared_ptr NotSupportedONNXNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { +std::shared_ptr NotSupportedONNXNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { const auto& attrs = get_attrs(); std::string error_message = attrs.at(failed_conversion_key); return std::make_shared(inputs, diff --git a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp index e705025613e..3c542df029f 100644 --- a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp +++ b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp @@ -1,5 +1,5 @@ //***************************************************************************** -// Copyright 2017-2022 Intel Corporation +// Copyright (C) 2017-2024 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public: return ov_nodes; } - virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; + virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; virtual bool visit_attributes(ov::AttributeVisitor& visitor) override { // TODO: implement reading as well, now it work for serialization only @@ -90,7 +90,7 @@ public: return m_models; } - virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; + virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; private: std::vector> m_models; @@ -123,7 +123,7 @@ public: return attrs[failed_conversion_key]; } - virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; + virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& inputs) const override; virtual bool visit_attributes(ov::AttributeVisitor& visitor) override; }; diff --git a/src/frontends/onnx/frontend/src/op/aten.cpp b/src/frontends/onnx/frontend/src/op/aten.cpp index 46f49bc7ff9..bfa7b13adc7 100644 --- a/src/frontends/onnx/frontend/src/op/aten.cpp +++ b/src/frontends/onnx/frontend/src/op/aten.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -65,12 +65,12 @@ ov::OutputVector aten(const Node& node) { const auto data_type = emb_tbl_in.get_element_type(); const auto ind_type = indices_in.get_element_type(); - const auto zero_const = std::make_shared(ind_type, Shape{}, 0); + const auto zero_const = std::make_shared(ind_type, ov::Shape{}, 0); // Shape aligned node, filled with zeros - const auto zero_of_data_type_const = std::make_shared(data_type, Shape{1}, 0); + const auto zero_of_data_type_const = std::make_shared(data_type, ov::Shape{1}, 0); const auto weights_shape_node = std::make_shared(emb_tbl_in, ind_type); - const auto weights_last_dim_idx = std::make_shared(ov::element::i32, Shape{1}, -1); + const auto weights_last_dim_idx = std::make_shared(ov::element::i32, ov::Shape{1}, -1); const auto weights_last_dim = std::make_shared(weights_shape_node, weights_last_dim_idx, zero_const); const auto zero_col_node = std::make_shared(zero_of_data_type_const, weights_last_dim); diff --git a/src/frontends/onnx/frontend/src/op/bitshift.cpp b/src/frontends/onnx/frontend/src/op/bitshift.cpp index 3cc224c9d17..afc942242d0 100644 --- a/src/frontends/onnx/frontend/src/op/bitshift.cpp +++ b/src/frontends/onnx/frontend/src/op/bitshift.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -31,7 +31,8 @@ ov::OutputVector bitshift(const Node& node) { "attribute. Given: ", direction); - auto shift = std::make_shared(v0::Constant::create(input_y.get_element_type(), Shape{1}, {2}), input_y); + auto shift = + std::make_shared(v0::Constant::create(input_y.get_element_type(), ov::Shape{1}, {2}), input_y); if (direction == "RIGHT") { return {std::make_shared(input_x, shift)}; diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp index 43f1c909c61..5e10e4b7a00 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -39,6 +39,7 @@ #include "ov_models/ov_builders/split.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp index 22a44c041ae..e3278c55d6a 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -17,6 +17,7 @@ #include "openvino/op/slice.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp index dea8a9ca5e8..5f7e07727d5 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -20,6 +20,7 @@ #include "openvino/op/tanh.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp index f6491b7a169..ce80624a9b6 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -16,6 +16,7 @@ #include "openvino/op/relu.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp index c062808a9ab..8e853aa0818 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "openvino/op/mvn.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/compress.cpp b/src/frontends/onnx/frontend/src/op/compress.cpp index 11875437528..023465f803b 100644 --- a/src/frontends/onnx/frontend/src/op/compress.cpp +++ b/src/frontends/onnx/frontend/src/op/compress.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "ov_models/ov_builders/reshape.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/constant.cpp b/src/frontends/onnx/frontend/src/op/constant.cpp index a79b863dad3..90571df7d67 100644 --- a/src/frontends/onnx/frontend/src/op/constant.cpp +++ b/src/frontends/onnx/frontend/src/op/constant.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,6 +13,7 @@ #include "openvino/op/constant.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp index 125e9dcbede..c6bd9c80b91 100644 --- a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -21,6 +21,8 @@ using namespace ov::op; using ov::CoordinateDiff; +using ov::Shape; +using ov::Strides; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/crop.cpp b/src/frontends/onnx/frontend/src/op/crop.cpp index 11353bd2190..fe959c230b1 100644 --- a/src/frontends/onnx/frontend/src/op/crop.cpp +++ b/src/frontends/onnx/frontend/src/op/crop.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "openvino/op/strided_slice.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/cum_sum.cpp b/src/frontends/onnx/frontend/src/op/cum_sum.cpp index 5ddabe73f9f..e53913ea084 100644 --- a/src/frontends/onnx/frontend/src/op/cum_sum.cpp +++ b/src/frontends/onnx/frontend/src/op/cum_sum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -27,7 +27,7 @@ ov::OutputVector cum_sum(const Node& node) { const auto& axis_shape = inputs.at(1).get_partial_shape(); axis = axis_shape.is_dynamic() ? inputs.at(1) : ngraph::onnx_import::reshape::interpret_as_scalar(inputs.at(1)); } else { - axis = v0::Constant::create(ov::element::i64, Shape{}, {0}); // default + axis = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); // default } return ov::OutputVector{std::make_shared(data, axis, exclusive, reverse)}; } diff --git a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp index de8ca326aa7..04d0007fdb3 100644 --- a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -131,7 +131,7 @@ std::shared_ptr reshape_input(const ov::Output& input, target_dims.push_back(1); } - const auto target_shape = v0::Constant::create(ov::element::i64, Shape{target_dims.size()}, target_dims); + const auto target_shape = v0::Constant::create(ov::element::i64, ov::Shape{target_dims.size()}, target_dims); return std::make_shared(input, target_shape, true); } diff --git a/src/frontends/onnx/frontend/src/op/dropout.cpp b/src/frontends/onnx/frontend/src/op/dropout.cpp index e7536cfc63f..560eb37ef16 100644 --- a/src/frontends/onnx/frontend/src/op/dropout.cpp +++ b/src/frontends/onnx/frontend/src/op/dropout.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -25,8 +25,9 @@ ov::OutputVector build_dropout(const Node& node, bool training_mode) { const bool return_mask = node.get_outputs_size() > 1; if (return_mask) { - const auto mask = std::make_shared(v0::Constant::create(ov::element::boolean, Shape{}, {true}), - std::make_shared(input_data)); + const auto mask = + std::make_shared(v0::Constant::create(ov::element::boolean, ov::Shape{}, {true}), + std::make_shared(input_data)); return {input_data, mask}; } else { return {input_data}; diff --git a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp index fad323df102..7da6fdbb7e9 100644 --- a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -23,6 +23,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/expand.cpp b/src/frontends/onnx/frontend/src/op/expand.cpp index 41aa4ed3b59..54d6299cd77 100644 --- a/src/frontends/onnx/frontend/src/op/expand.cpp +++ b/src/frontends/onnx/frontend/src/op/expand.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,6 +9,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/gather.hpp b/src/frontends/onnx/frontend/src/op/gather.hpp index f8335407e5e..5324eb3108f 100644 --- a/src/frontends/onnx/frontend/src/op/gather.hpp +++ b/src/frontends/onnx/frontend/src/op/gather.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -23,7 +23,7 @@ inline ov::OutputVector gather(const Node& node) { return {std::make_shared(data, indices, - ov::op::v0::Constant::create(ov::element::i64, Shape{}, {axis}))}; + ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {axis}))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/gemm.cpp b/src/frontends/onnx/frontend/src/op/gemm.cpp index 1c4a7dac1d1..eb4a04bae75 100644 --- a/src/frontends/onnx/frontend/src/op/gemm.cpp +++ b/src/frontends/onnx/frontend/src/op/gemm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "ov_models/ov_builders/reshape.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp index 633e6d1f11e..3e3abdad663 100644 --- a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "openvino/op/squeeze.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp index 7878fe79731..c2b3ff92bef 100644 --- a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,6 +11,7 @@ #include "openvino/op/squeeze.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/group_normalization.cpp b/src/frontends/onnx/frontend/src/op/group_normalization.cpp index 233b55ad994..99837fa716d 100644 --- a/src/frontends/onnx/frontend/src/op/group_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/group_normalization.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -14,6 +14,7 @@ #include "openvino/op/unsqueeze.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/gru.cpp b/src/frontends/onnx/frontend/src/op/gru.cpp index 4726a18e52a..75f7821c1f1 100644 --- a/src/frontends/onnx/frontend/src/op/gru.cpp +++ b/src/frontends/onnx/frontend/src/op/gru.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -14,6 +14,7 @@ #include "utils/recurrent.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp index 4375eb11369..3613aa28183 100644 --- a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp +++ b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -8,6 +8,7 @@ #include "openvino/op/hard_sigmoid.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/hardmax.cpp b/src/frontends/onnx/frontend/src/op/hardmax.cpp index 65803381c69..8a2c28406a7 100644 --- a/src/frontends/onnx/frontend/src/op/hardmax.cpp +++ b/src/frontends/onnx/frontend/src/op/hardmax.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -18,6 +18,7 @@ #include "validation_util.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp index 0698a37fbdc..aa3f9b30cce 100644 --- a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp @@ -27,6 +27,7 @@ using namespace ov::op; using namespace ov::op::v0; using namespace ov::op::v1; using namespace ov::op::v8; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp index 92bcdde845e..af35bd1cfd4 100644 --- a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,6 +9,7 @@ #include "openvino/op/prelu.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/log_softmax.cpp b/src/frontends/onnx/frontend/src/op/log_softmax.cpp index 8294b7251ea..2a0c064ebd9 100644 --- a/src/frontends/onnx/frontend/src/op/log_softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/log_softmax.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -14,6 +14,7 @@ #include "validation_util.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/lp_pool.cpp b/src/frontends/onnx/frontend/src/op/lp_pool.cpp index 824ae2c7d33..86154a6b837 100644 --- a/src/frontends/onnx/frontend/src/op/lp_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_pool.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -14,6 +14,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/lstm.cpp b/src/frontends/onnx/frontend/src/op/lstm.cpp index 72d45c9f915..ff72ab0f5a8 100644 --- a/src/frontends/onnx/frontend/src/op/lstm.cpp +++ b/src/frontends/onnx/frontend/src/op/lstm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -19,6 +19,7 @@ #include "ov_models/ov_builders/split.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp index be9bc4c8dad..b63c4c3519f 100644 --- a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -26,7 +26,7 @@ ov::OutputVector max_roi_pool(const Node& node) { const auto pooled_shape = node.get_attribute_value>("pooled_shape"); const auto spatial_scale = node.get_attribute_value("spatial_scale", 1.0); - return {std::make_shared(X, rois, Shape(pooled_shape), spatial_scale, "max")}; + return {std::make_shared(X, rois, ov::Shape(pooled_shape), spatial_scale, "max")}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/mean.cpp b/src/frontends/onnx/frontend/src/op/mean.cpp index c0cb27b7c05..ce2390c056b 100644 --- a/src/frontends/onnx/frontend/src/op/mean.cpp +++ b/src/frontends/onnx/frontend/src/op/mean.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -18,7 +18,7 @@ namespace op { namespace set_1 { ov::OutputVector mean(const Node& node) { auto sum = variadic::make_ng_variadic_op(node).front(); - auto count = v0::Constant::create(sum.get_element_type(), Shape{}, {node.get_ng_inputs().size()}); + auto count = v0::Constant::create(sum.get_element_type(), ov::Shape{}, {node.get_ng_inputs().size()}); return {std::make_shared(sum, count)}; } diff --git a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp index 8c29c790f28..f610097ea3e 100644 --- a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -31,7 +31,7 @@ ov::OutputVector mean_variance_normalization(const Node& node) { auto axes = node.get_attribute_value>("axes", {0, 2, 3}); const std::vector normalized_axes = ov::util::normalize_axes(node.get_description(), axes, data.get_partial_shape().rank()); - auto const_axes = v0::Constant::create(ov::element::i64, Shape{normalized_axes.size()}, normalized_axes); + auto const_axes = v0::Constant::create(ov::element::i64, ov::Shape{normalized_axes.size()}, normalized_axes); return {std::make_shared(data, const_axes, true, 1e-09f, ov::op::MVNEpsMode::OUTSIDE_SQRT)}; } diff --git a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp index 13a92b7f916..410373d4217 100644 --- a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp +++ b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -21,9 +21,9 @@ inline ov::OutputVector nms_rotated(const Node& node) { auto iou_threshold = node.get_attribute_value("iou_threshold"); auto score_threshold = node.get_attribute_value("score_threshold"); auto max_output_boxes_per_class = - ov::op::v0::Constant::create(ov::element::i64, Shape{1}, {std::numeric_limits::max()}); - auto iou_threshold_const = ov::op::v0::Constant::create(ov::element::f32, Shape{}, {iou_threshold}); - auto score_threshold_const = ov::op::v0::Constant::create(ov::element::f32, Shape{}, {score_threshold}); + ov::op::v0::Constant::create(ov::element::i64, ov::Shape{1}, {std::numeric_limits::max()}); + auto iou_threshold_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{}, {iou_threshold}); + auto score_threshold_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{}, {score_threshold}); auto nms = std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1), diff --git a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp index d1e6f71632a..0b1e9968d5f 100644 --- a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp +++ b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,6 +10,7 @@ #include "utils/reshape.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp index d2c03b71edc..05b1ab6b815 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Intel Corporation +// Copyright (C) 2022-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,6 +12,7 @@ #include "openvino/op/shape_of.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp index 76e40c143a0..972bc14e000 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,6 +13,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp index 22dd23ca210..99c9f2c9969 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -15,6 +15,7 @@ #include "openvino/op/unsqueeze.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp index 70c25e7d4b1..9f1e08c5fa1 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,6 +10,7 @@ #include "utils/reshape.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp index d28a07d12ff..3e2e3e3db47 100644 --- a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -16,6 +16,7 @@ #include "validation_util.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/random_normal.cpp b/src/frontends/onnx/frontend/src/op/random_normal.cpp index d60f9994bb9..7c3e0c853af 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal.cpp +++ b/src/frontends/onnx/frontend/src/op/random_normal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,6 +10,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp index 48214824f17..0eb38789c89 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp +++ b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,6 +9,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/reciprocal.cpp b/src/frontends/onnx/frontend/src/op/reciprocal.cpp index 46bd6bfc61d..34504bb2fd2 100644 --- a/src/frontends/onnx/frontend/src/op/reciprocal.cpp +++ b/src/frontends/onnx/frontend/src/op/reciprocal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -8,6 +8,7 @@ #include "openvino/op/divide.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/reduce.cpp b/src/frontends/onnx/frontend/src/op/reduce.cpp index 1246445119b..363519f803c 100644 --- a/src/frontends/onnx/frontend/src/op/reduce.cpp +++ b/src/frontends/onnx/frontend/src/op/reduce.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -24,6 +24,7 @@ #include "utils/common.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/scan.cpp b/src/frontends/onnx/frontend/src/op/scan.cpp index 42d1fe2618d..23c6feb665c 100644 --- a/src/frontends/onnx/frontend/src/op/scan.cpp +++ b/src/frontends/onnx/frontend/src/op/scan.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -49,7 +49,7 @@ ov::OutputVector scan_to_tensor_iterator(const ov::OutputVector& node_inputs, for (int64_t i = 0; i < num_scan_inputs; ++i) { const auto in_idx = num_initial_values + i; auto axis = scan_input_axes[i]; - const auto axis_node = v0::Constant::create(ov::element::i64, Shape{1}, {axis}); + const auto axis_node = v0::Constant::create(ov::element::i64, ov::Shape{1}, {axis}); auto shape = node_inputs[in_idx + in_offset].get_partial_shape(); if (shape.rank().is_static()) { axis = ov::util::normalize_axis(node_description, @@ -70,7 +70,7 @@ ov::OutputVector scan_to_tensor_iterator(const ov::OutputVector& node_inputs, for (size_t i = 0; i < num_scan_outputs; ++i) { const auto out_idx = num_initial_values + i; const auto axis = scan_output_axes[i]; - const auto axis_node = v0::Constant::create(ov::element::i64, Shape{1}, {axis}); + const auto axis_node = v0::Constant::create(ov::element::i64, ov::Shape{1}, {axis}); body_outputs[out_idx] = std::make_shared(body_outputs[out_idx], axis_node); } diff --git a/src/frontends/onnx/frontend/src/op/selu.cpp b/src/frontends/onnx/frontend/src/op/selu.cpp index 906d7641a8c..fe5b56bb06d 100644 --- a/src/frontends/onnx/frontend/src/op/selu.cpp +++ b/src/frontends/onnx/frontend/src/op/selu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -19,9 +19,9 @@ ov::OutputVector selu(const Node& node) { auto alpha = node.get_attribute_value("alpha", 1.67326319217681884765625); auto gamma = node.get_attribute_value("gamma", 1.05070102214813232421875); - auto alpha_node = v0::Constant::create(data.get_element_type(), Shape{}, {alpha}); + auto alpha_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {alpha}); - auto gamma_node = v0::Constant::create(data.get_element_type(), Shape{}, {gamma}); + auto gamma_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {gamma}); return {std::make_shared(data, alpha_node, gamma_node)}; } diff --git a/src/frontends/onnx/frontend/src/op/shrink.cpp b/src/frontends/onnx/frontend/src/op/shrink.cpp index 6e942282bbe..4ffb0b2073d 100644 --- a/src/frontends/onnx/frontend/src/op/shrink.cpp +++ b/src/frontends/onnx/frontend/src/op/shrink.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -30,16 +30,16 @@ ov::OutputVector shrink(const Node& node) { std::shared_ptr negative_lambd; const auto input_element_type = input.get_element_type(); if (input_element_type.is_signed()) { - negative_lambd = v0::Constant::create(input_element_type, Shape{}, {-lambd}); + negative_lambd = v0::Constant::create(input_element_type, ov::Shape{}, {-lambd}); } else { // Passing -lambd to unsigned type constant will cause an overflow. // For unsigned types the lowest possible value is 0. - negative_lambd = v0::Constant::create(input_element_type, Shape{}, {0}); + negative_lambd = v0::Constant::create(input_element_type, ov::Shape{}, {0}); } - const auto positive_lambd = v0::Constant::create(input_element_type, Shape{}, {lambd}); + const auto positive_lambd = v0::Constant::create(input_element_type, ov::Shape{}, {lambd}); - const auto bias_tensor = v0::Constant::create(input_element_type, Shape{}, {bias}); + const auto bias_tensor = v0::Constant::create(input_element_type, ov::Shape{}, {bias}); // Create a mask indicating locations of values that need to be adjusted // by adding and subtracting bias diff --git a/src/frontends/onnx/frontend/src/op/size.cpp b/src/frontends/onnx/frontend/src/op/size.cpp index 34aaba3d348..df4b3343176 100644 --- a/src/frontends/onnx/frontend/src/op/size.cpp +++ b/src/frontends/onnx/frontend/src/op/size.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -17,7 +17,7 @@ namespace op { namespace set_1 { ov::OutputVector size(const Node& node) { auto data = node.get_ng_inputs().at(0); - auto axes = v0::Constant::create(ov::element::i32, Shape{}, {0}); + auto axes = v0::Constant::create(ov::element::i32, ov::Shape{}, {0}); auto input_shape = std::make_shared(data); return {std::make_shared(input_shape, axes)}; } diff --git a/src/frontends/onnx/frontend/src/op/slice.cpp b/src/frontends/onnx/frontend/src/op/slice.cpp index 69fa0979432..cfee29ed1a0 100644 --- a/src/frontends/onnx/frontend/src/op/slice.cpp +++ b/src/frontends/onnx/frontend/src/op/slice.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,6 +12,8 @@ using namespace ov::op; +using ov::Shape; + OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/op/softmax.cpp b/src/frontends/onnx/frontend/src/op/softmax.cpp index 1e37e37af86..ddae97314dd 100644 --- a/src/frontends/onnx/frontend/src/op/softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/softmax.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -38,7 +38,7 @@ ov::OutputVector softmax(const Node& node) { std::shared_ptr result; switch (data_rank.get_length()) { case 0: { - result = v0::Constant::create(data.get_element_type(), Shape{}, {1}); + result = v0::Constant::create(data.get_element_type(), ov::Shape{}, {1}); break; } default: { @@ -61,7 +61,7 @@ ov::OutputVector softmax(const Node& node) { std::shared_ptr result; switch (data_rank.get_length()) { case 0: { - result = v0::Constant::create(data.get_element_type(), Shape{}, {1}); + result = v0::Constant::create(data.get_element_type(), ov::Shape{}, {1}); break; } default: { diff --git a/src/frontends/onnx/frontend/src/op/split.cpp b/src/frontends/onnx/frontend/src/op/split.cpp index e52d86989d0..ec217e86932 100644 --- a/src/frontends/onnx/frontend/src/op/split.cpp +++ b/src/frontends/onnx/frontend/src/op/split.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -39,7 +39,7 @@ ov::OutputVector split(const Node& node) { const auto outputs_number = node.get_output_names().size(); return ov::op::util::split(inputs.at(0), outputs_number, axis); } else { - const auto axis_node = v0::Constant::create(ov::element::Type_t::i64, Shape{}, {axis}); + const auto axis_node = v0::Constant::create(ov::element::Type_t::i64, ov::Shape{}, {axis}); return {std::make_shared(inputs.at(0), axis_node, inputs.at(1))->outputs()}; } } diff --git a/src/frontends/onnx/frontend/src/op/squeeze.cpp b/src/frontends/onnx/frontend/src/op/squeeze.cpp index 8a683ca9b17..5c03b8b128f 100644 --- a/src/frontends/onnx/frontend/src/op/squeeze.cpp +++ b/src/frontends/onnx/frontend/src/op/squeeze.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -21,7 +21,7 @@ ov::OutputVector squeeze(const Node& node) { if (axes.empty()) { return {std::make_shared(data)}; } else { - const auto axes_const = std::make_shared(ov::element::i64, Shape{axes.size()}, axes); + const auto axes_const = std::make_shared(ov::element::i64, ov::Shape{axes.size()}, axes); return {std::make_shared(data, axes_const)}; } } diff --git a/src/frontends/onnx/frontend/src/op/stft.cpp b/src/frontends/onnx/frontend/src/op/stft.cpp index 1e8c7a5a849..436bceaf21a 100644 --- a/src/frontends/onnx/frontend/src/op/stft.cpp +++ b/src/frontends/onnx/frontend/src/op/stft.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -19,6 +19,7 @@ #include "utils/dft.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp index fa08154f780..7a94ab9f3f8 100644 --- a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -20,7 +20,7 @@ ov::OutputVector thresholded_relu(const Node& node) { const auto data = node.get_ng_inputs().at(0); const double alpha = node.get_attribute_value("alpha", 1.0); - const auto alpha_node = v0::Constant::create(data.get_element_type(), Shape{}, {alpha}); + const auto alpha_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {alpha}); const auto data_map = std::make_shared(std::make_shared(data, alpha_node), data.get_element_type()); diff --git a/src/frontends/onnx/frontend/src/op/trilu.cpp b/src/frontends/onnx/frontend/src/op/trilu.cpp index 472e7125ce1..da881684862 100644 --- a/src/frontends/onnx/frontend/src/op/trilu.cpp +++ b/src/frontends/onnx/frontend/src/op/trilu.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Intel Corporation +// Copyright (C) 2022-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -43,8 +43,8 @@ ov::OutputVector trilu(const Node& node) { } const auto shape = std::make_shared(input); - const auto zero = v0::Constant::create(ov::element::i64, Shape{}, {0}); - const auto one = v0::Constant::create(ov::element::i64, Shape{}, {1}); + const auto zero = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); + const auto one = v0::Constant::create(ov::element::i64, ov::Shape{}, {1}); // The approach here is to create a mask, that later can be used in Select operator // to choose appropiate values from the input @@ -74,8 +74,8 @@ ov::OutputVector trilu(const Node& node) { // fetch last two dimensions of input shape // M = shape[-1] // N = shape[-2] - const auto M = std::make_shared(shape, v0::Constant::create(ov::element::i32, Shape{}, {-1}), zero); - const auto N = std::make_shared(shape, v0::Constant::create(ov::element::i32, Shape{}, {-2}), zero); + const auto M = std::make_shared(shape, v0::Constant::create(ov::element::i32, ov::Shape{}, {-1}), zero); + const auto N = std::make_shared(shape, v0::Constant::create(ov::element::i32, ov::Shape{}, {-2}), zero); // create 2D tensor with shape [1, M] and values [[0, 1, ..., M - 1]] const auto horizontal_range = @@ -98,7 +98,8 @@ ov::OutputVector trilu(const Node& node) { mask = std::make_shared(horizontal_range, vertical_range); } - return {std::make_shared(mask, input, v0::Constant::create(input.get_element_type(), Shape{}, {0}))}; + return { + std::make_shared(mask, input, v0::Constant::create(input.get_element_type(), ov::Shape{}, {0}))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/upsample.cpp b/src/frontends/onnx/frontend/src/op/upsample.cpp index acacb1031cb..bced1015bb5 100644 --- a/src/frontends/onnx/frontend/src/op/upsample.cpp +++ b/src/frontends/onnx/frontend/src/op/upsample.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -73,7 +73,7 @@ ov::OutputVector upsample(const onnx_import::Node& node) { scales[rank_size - 1] = width_scale; scales[rank_size - 2] = height_scale; - const auto scales_const = v0::Constant::create(ov::element::f32, Shape({scales.size()}), scales); + const auto scales_const = v0::Constant::create(ov::element::f32, ov::Shape({scales.size()}), scales); return std::make_shared(data, scales_const, get_attributes(mode))->outputs(); } @@ -94,7 +94,7 @@ ov::OutputVector upsample(const onnx_import::Node& node) { "Input tensor's rank is required to be the same as number of " "elements of 'scales' attribute."); - const auto scales_const = v0::Constant::create(ov::element::f32, Shape({scales.size()}), scales); + const auto scales_const = v0::Constant::create(ov::element::f32, ov::Shape({scales.size()}), scales); return std::make_shared(data, scales_const, get_attributes(mode))->outputs(); } diff --git a/src/frontends/onnx/frontend/src/utils/common.cpp b/src/frontends/onnx/frontend/src/utils/common.cpp index 73e982df4c0..b41c7bd055d 100644 --- a/src/frontends/onnx/frontend/src/utils/common.cpp +++ b/src/frontends/onnx/frontend/src/utils/common.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -21,6 +21,7 @@ #include "openvino/op/subtract.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/utils/common.hpp b/src/frontends/onnx/frontend/src/utils/common.hpp index 08df9160fdd..abd9e6d1cb9 100644 --- a/src/frontends/onnx/frontend/src/utils/common.hpp +++ b/src/frontends/onnx/frontend/src/utils/common.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -75,7 +75,7 @@ std::shared_ptr get_monotonic_range_along_node_rank(const ov::Output -std::shared_ptr shifted_square_identity(const Shape output_shape, +std::shared_ptr shifted_square_identity(const ov::Shape output_shape, const ov::element::Type& output_type, const std::int64_t shift) { std::vector identity_matrix(shape_size(output_shape), T{0}); @@ -101,7 +101,7 @@ std::shared_ptr shifted_square_identity(const Shape output /// \return A Constant node representing identity matrix with shape (n, n). template std::shared_ptr square_identity(const size_t n, const ov::element::Type& type) { - return shifted_square_identity(Shape{n, n}, type, 0); + return shifted_square_identity(ov::Shape{n, n}, type, 0); } /// \brief Performs validation of an input that is expected to be a scalar. diff --git a/src/frontends/onnx/frontend/src/utils/convpool.hpp b/src/frontends/onnx/frontend/src/utils/convpool.hpp index b1159204460..544e4620841 100644 --- a/src/frontends/onnx/frontend/src/utils/convpool.hpp +++ b/src/frontends/onnx/frontend/src/utils/convpool.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -18,7 +18,7 @@ namespace convpool { /// /// \param node The Node ptr representing Conv or Pool operation. /// \return The kernel Shape object representing its dimensions (height, width, depth). -Shape get_kernel_shape(const Node& node); +ov::Shape get_kernel_shape(const Node& node); /// /// \brief Get number of pixels to stride operation by in each direction. @@ -28,7 +28,7 @@ Shape get_kernel_shape(const Node& node); /// /// \return The kernel Shape object representing its dimensions (height, width, /// depth). -Strides get_strides(const Node& node, const std::size_t kernel_rank = 0UL); +ov::Strides get_strides(const Node& node, const std::size_t kernel_rank = 0UL); /// /// \brief Get number of pixels for filter dilation in each direction. @@ -38,7 +38,7 @@ Strides get_strides(const Node& node, const std::size_t kernel_rank = 0UL); /// /// \return The Strides object containing number of pixels for filter dilation /// (height, width, depth). -Strides get_dilations(const Node& node, const std::size_t kernel_rank = 0UL); +ov::Strides get_dilations(const Node& node, const std::size_t kernel_rank = 0UL); /// \brief Gets the 'ceil_mode' (rounding type) attribute value. /// @@ -82,10 +82,10 @@ std::pair get_pads(const Node& node); /// \param[in,out] padding_above The paddings above axis. /// /// \see ov::op::PadType -void calculate_auto_pads(const Shape& data_shape, - const Shape& filter_shape, - const Strides& strides, - const Strides& dilations, +void calculate_auto_pads(const ov::Shape& data_shape, + const ov::Shape& filter_shape, + const ov::Strides& strides, + const ov::Strides& dilations, const ov::op::PadType& pad_type, ov::CoordinateDiff& padding_below, ov::CoordinateDiff& padding_above); diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp index 9a7663a691c..1f460812ad6 100644 --- a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -15,6 +15,7 @@ #include "utils/convpool.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp index 6a2dc85553d..df5528795da 100644 --- a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp +++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -55,11 +55,11 @@ protected: Node m_onnx_node; OPENVINO_SUPPRESS_DEPRECATED_END const ov::OutputVector m_inputs; - Shape m_kernel_shape; - Strides m_strides; - Strides m_dilations; - Shape m_padding_below; - Shape m_padding_above; + ov::Shape m_kernel_shape; + ov::Strides m_strides; + ov::Strides m_dilations; + ov::Shape m_padding_below; + ov::Shape m_padding_above; ov::op::PadType m_auto_pad; ov::op::RoundingType m_rounding_type; diff --git a/src/frontends/onnx/frontend/src/utils/recurrent.cpp b/src/frontends/onnx/frontend/src/utils/recurrent.cpp index ef2de919091..0c18485c76f 100644 --- a/src/frontends/onnx/frontend/src/utils/recurrent.cpp +++ b/src/frontends/onnx/frontend/src/utils/recurrent.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -22,6 +22,7 @@ #include "ov_models/ov_builders/split.hpp" using namespace ov::op; +using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/utils/reshape.cpp b/src/frontends/onnx/frontend/src/utils/reshape.cpp index 36f051cc399..34be077fec9 100644 --- a/src/frontends/onnx/frontend/src/utils/reshape.cpp +++ b/src/frontends/onnx/frontend/src/utils/reshape.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -20,6 +20,7 @@ #include "utils/reshape.hpp" using namespace ov::op; +using ov::Shape; namespace ngraph { namespace onnx_import { diff --git a/src/inference/src/dev/plugin.cpp b/src/inference/src/dev/plugin.cpp index 45e66e91c6c..f8bfb69250f 100644 --- a/src/inference/src/dev/plugin.cpp +++ b/src/inference/src/dev/plugin.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/mvn_transformation.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/mvn_transformation.cpp index e3dcb71b8f2..a1701082f4a 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/mvn_transformation.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/mvn_transformation.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -15,7 +15,7 @@ const std::vector inputAndQuantizationShapes = { { 1ul, 4ul, 16ul, 16ul }, }; -const std::vector reductionAxes = { { 2, 3 }, { 1, 2, 3 } }; +const std::vector reductionAxes = {{2, 3}, {1, 2, 3}}; const std::vector normalizeVariance = { true, false }; diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/topk.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/topk.cpp index e5a7947b545..ff8e64580ff 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/topk.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/topk.cpp @@ -5,8 +5,8 @@ #include "single_op_tests/topk.hpp" namespace { -using ov::test::TopKLayerTest; using ov::test::TopK11LayerTest; +using ov::test::TopKLayerTest; std::vector shapes = {{10, 10, 10}}; diff --git a/src/tests/functional/plugin/shared/include/low_precision_transformations/fuse_convert_transformation.hpp b/src/tests/functional/plugin/shared/include/low_precision_transformations/fuse_convert_transformation.hpp index e9480ca3022..60017785053 100644 --- a/src/tests/functional/plugin/shared/include/low_precision_transformations/fuse_convert_transformation.hpp +++ b/src/tests/functional/plugin/shared/include/low_precision_transformations/fuse_convert_transformation.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,8 +11,6 @@ #include "ov_lpt_models/common/fake_quantize_on_data.hpp" #include "ov_lpt_models/common/dequantization_operations.hpp" -using namespace ngraph; - namespace LayerTestsDefinitions { typedef std:: diff --git a/src/tests/functional/plugin/shared/include/low_precision_transformations/mvn_transformation.hpp b/src/tests/functional/plugin/shared/include/low_precision_transformations/mvn_transformation.hpp index 4ef4380719e..556c3012188 100644 --- a/src/tests/functional/plugin/shared/include/low_precision_transformations/mvn_transformation.hpp +++ b/src/tests/functional/plugin/shared/include/low_precision_transformations/mvn_transformation.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,8 +10,6 @@ #include "shared_test_classes/base/low_precision_transformations/layer_transformation.hpp" #include "ov_lpt_models/common/fake_quantize_on_data.hpp" -using namespace ngraph; - namespace LayerTestsDefinitions { typedef std::tuple MVNTransformationParams; diff --git a/src/tests/functional/plugin/shared/src/precomp.hpp b/src/tests/functional/plugin/shared/src/precomp.hpp index 593398719c2..3ea31e6cbe2 100644 --- a/src/tests/functional/plugin/shared/src/precomp.hpp +++ b/src/tests/functional/plugin/shared/src/precomp.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/broadcast.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/broadcast.hpp index 1c575029121..e2634eaf5b0 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/broadcast.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/broadcast.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,13 +13,12 @@ namespace LayerTestsDefinitions { -using BroadcastParamsTuple = typename std::tuple< - InferenceEngine::SizeVector, // target shape - ov::AxisSet, // axes mapping - ov::op::BroadcastType, // broadcast mode - InferenceEngine::SizeVector, // Input shape - InferenceEngine::Precision, // Network precision - std::string>; // Device name +using BroadcastParamsTuple = typename std::tuple; // Device name class BroadcastLayerTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp index 892cf4a959f..2a874e11c8c 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/interpolate.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -65,18 +65,18 @@ protected: } // namespace v11 //Interpolate-1 test -typedef std::tuple< - InferenceEngine::Precision, // Net precision - InferenceEngine::Precision, // Input precision, output is the same - InferenceEngine::Layout, // Input layout, output is the same - InferenceEngine::SizeVector, // Input shapes - InferenceEngine::SizeVector, // Target shapes - std::string, // InterpolateMode - ov::AxisSet, // Axes - bool, // AntiAlias - std::vector, // Pads - LayerTestsUtils::TargetDevice // Device name -> Interpolate1LayerTestParams; +typedef std::tuple, // Pads + LayerTestsUtils::TargetDevice // Device name + > + Interpolate1LayerTestParams; class Interpolate1LayerTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/mvn.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/mvn.hpp index 4950959c180..e4fafdc499b 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/mvn.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/mvn.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,15 +11,15 @@ namespace LayerTestsDefinitions { -typedef std::tuple< - InferenceEngine::SizeVector, // Input shapes - InferenceEngine::Precision, // Input precision - ov::AxisSet, // Reduction axes - bool, // Across channels - bool, // Normalize variance - double, // Epsilon - std::string // Device name - > mvn1Params; +typedef std::tuple + mvn1Params; class Mvn1LayerTest : public testing::WithParamInterface, virtual public LayerTestsUtils::LayerTestsCommon { public: diff --git a/src/tests/functional/shared_test_classes/src/single_layer/extract_image_patches.cpp b/src/tests/functional/shared_test_classes/src/single_layer/extract_image_patches.cpp index 4ffcca538ab..e59aa21c4d3 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/extract_image_patches.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/extract_image_patches.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -40,8 +40,11 @@ void ExtractImagePatchesTest::SetUp() { auto inputNode = std::make_shared(ngPrc, ov::Shape(inputShape)); ov::ParameterVector params = {inputNode}; - auto extImgPatches = std::make_shared( - inputNode, ov::Shape(kernel), ngraph::Strides(strides), ov::Shape(rates), pad_type); + auto extImgPatches = std::make_shared(inputNode, + ov::Shape(kernel), + ov::Strides(strides), + ov::Shape(rates), + pad_type); ov::ResultVector results{std::make_shared(extImgPatches)}; function = std::make_shared(results, params, "ExtractImagePatches"); } diff --git a/src/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp b/src/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp index 7d342a796e9..284357ba8b8 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/interpolate.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // diff --git a/src/tests/functional/shared_test_classes/src/single_layer/memory.cpp b/src/tests/functional/shared_test_classes/src/single_layer/memory.cpp index 87a6a213385..8c629ca73b6 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/memory.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/memory.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -181,7 +181,7 @@ void MemoryTest::CreateTIFunc() { void MemoryTest::CreateCommonFunc() { ov::ParameterVector param{std::make_shared(ngPrc, ov::Shape(inputShape))}; const auto variable_info = targetDevice == ov::test::utils::DEVICE_GPU - ? ov::op::util::VariableInfo{Shape{inputShape}, ngPrc, "v0"} + ? ov::op::util::VariableInfo{ov::Shape{inputShape}, ngPrc, "v0"} : ov::op::util::VariableInfo{inputShape, ngPrc, "v0"}; auto variable = std::make_shared(variable_info); auto read_value = CreateReadValueOp(param.at(0), variable); diff --git a/src/tests/functional/shared_test_classes/src/single_layer/mvn.cpp b/src/tests/functional/shared_test_classes/src/single_layer/mvn.cpp index 8c2ef53b09c..01caab43385 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/mvn.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/mvn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // diff --git a/src/tests/functional/shared_test_classes/src/single_layer/non_max_suppression.cpp b/src/tests/functional/shared_test_classes/src/single_layer/non_max_suppression.cpp index 47b3f89f11e..13c49d694b6 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/non_max_suppression.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/non_max_suppression.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -333,11 +333,14 @@ void NmsLayerTest::SetUp() { function = std::make_shared(nms, params, "NMS"); } else { auto nms_0_identity = - std::make_shared(nms->output(0), ov::op::v0::Constant::create(outType, Shape{1}, {1})); + std::make_shared(nms->output(0), + ov::op::v0::Constant::create(outType, ov::Shape{1}, {1})); auto nms_1_identity = - std::make_shared(nms->output(1), ov::op::v0::Constant::create(ngPrc, Shape{1}, {1})); + std::make_shared(nms->output(1), + ov::op::v0::Constant::create(ngPrc, ov::Shape{1}, {1})); auto nms_2_identity = - std::make_shared(nms->output(2), ov::op::v0::Constant::create(outType, Shape{1}, {1})); + std::make_shared(nms->output(2), + ov::op::v0::Constant::create(outType, ov::Shape{1}, {1})); nms_0_identity->set_friendly_name("Multiply_0"); nms_1_identity->set_friendly_name("Multiply_1"); nms_2_identity->set_friendly_name("Multiply_2"); diff --git a/src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp b/src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp index 511754f4e93..462c83f7662 100644 --- a/src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp +++ b/src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -72,7 +72,7 @@ std::shared_ptr makeInputLayer(const ov::element::Type& type, ov::test::utils::InputLayerType inputType, const std::vector& shape); -std::shared_ptr makeConvolution(const ov::Output& in, +std::shared_ptr makeConvolution(const ov::Output& in, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -85,8 +85,8 @@ std::shared_ptr makeConvolution(const ov::Output& in, const std::vector& filterWeights = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeConvolution(const ov::Output& in_data, - const ov::Output& in_weights, +std::shared_ptr makeConvolution(const ov::Output& in_data, + const ov::Output& in_weights, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -98,7 +98,7 @@ std::shared_ptr makeConvolution(const ov::Output& in_data, bool addBiases = false, const std::vector& biasesWeights = {}); -std::shared_ptr makeGroupConvolution(const ov::Output& in, +std::shared_ptr makeGroupConvolution(const ov::Output& in, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -112,8 +112,8 @@ std::shared_ptr makeGroupConvolution(const ov::Output& in, const std::vector& filterWeights = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeGroupConvolution(const ov::Output& in, - const ov::Output& weights, +std::shared_ptr makeGroupConvolution(const ov::Output& in, + const ov::Output& weights, const ov::element::Type& type, const std::vector& strides, const std::vector& padsBegin, @@ -123,7 +123,7 @@ std::shared_ptr makeGroupConvolution(const ov::Output& in, bool addBiases = false, const std::vector& biasesWeights = {}); -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -137,8 +137,8 @@ std::shared_ptr makeConvolutionBackpropData(const ov::Output& in const std::vector& filterWeights = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, - const ov::Output& weights, +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, + const ov::Output& weights, const ov::element::Type& type, const std::vector& strides, const std::vector& padsBegin, @@ -149,8 +149,8 @@ std::shared_ptr makeConvolutionBackpropData(const ov::Output& in const std::vector& outputPadding = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, - const ov::Output& outputShape, +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, + const ov::Output& outputShape, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -165,23 +165,23 @@ std::shared_ptr makeConvolutionBackpropData(const ov::Output& in const std::vector& biasesWeights = {}); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeCTCGreedyDecoder(const ov::Output& inputData, const bool mergeRepeated); +std::shared_ptr makeCTCGreedyDecoder(const ov::Output& inputData, const bool mergeRepeated); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, - const ov::Output& sequenceLength, +std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, + const ov::Output& sequenceLength, int blankIndex, bool mergeRepeated, const ov::element::Type& idxPrecision = ov::element::i32); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, +std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, int blankIndex, bool mergeRepeated, const ov::element::Type& idxPrecision = ov::element::i32); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeCTCLoss(const ov::Output& logitsNode, +std::shared_ptr makeCTCLoss(const ov::Output& logitsNode, std::vector& logitsLength, std::vector>& labels, std::vector& labelsLength, @@ -192,7 +192,7 @@ std::shared_ptr makeCTCLoss(const ov::Output& logitsNode, const bool ctcMergeRepeated, const bool unique); -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -207,8 +207,8 @@ std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& filterWeights = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, - const ov::Output& weights, +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, + const ov::Output& weights, const ov::element::Type& type, const std::vector& strides, const std::vector& padsBegin, @@ -219,8 +219,8 @@ std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& outputPadding = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, - const ov::Output& outputShape, +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, + const ov::Output& outputShape, const ov::element::Type& type, const std::vector& filterSize, const std::vector& strides, @@ -235,7 +235,7 @@ std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& filterWeights = {}, const std::vector& biasesWeights = {}); -std::shared_ptr makeBinaryConvolution(const ov::Output& in, +std::shared_ptr makeBinaryConvolution(const ov::Output& in, const std::vector& filterSize, const std::vector& strides, const std::vector& padsBegin, @@ -247,12 +247,12 @@ std::shared_ptr makeBinaryConvolution(const ov::Output& in, const std::vector& filterWeihgts = {}); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSplit(const ov::Output& in, +std::shared_ptr makeSplit(const ov::Output& in, const ov::element::Type& type, size_t numSplits, int64_t axis); -std::shared_ptr makeActivation(const ov::Output& in, +std::shared_ptr makeActivation(const ov::Output& in, const ov::element::Type& type, ov::test::utils::ActivationTypes activationType, std::vector inShape = {}, @@ -262,26 +262,26 @@ std::shared_ptr makeActivation(const ov::ParameterVector& parameters, const ov::element::Type& type, ov::test::utils::ActivationTypes activationType); -std::shared_ptr makeEltwise(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeEltwise(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::EltwiseTypes eltwiseType); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeBatchToSpace(const ov::Output& in, +std::shared_ptr makeBatchToSpace(const ov::Output& in, const ov::element::Type& type, const std::vector& blockShape, const std::vector& cropsBegin, const std::vector& cropsEnd); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSpaceToBatch(const ov::Output& in, +std::shared_ptr makeSpaceToBatch(const ov::Output& in, const ov::element::Type& type, const std::vector& blockShape, const std::vector& padsBegin, const std::vector& padsEnd); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSlice(const ov::Output& in, +std::shared_ptr makeSlice(const ov::Output& in, const std::vector& begin, const std::vector& end, const std::vector& stride, @@ -289,48 +289,51 @@ std::shared_ptr makeSlice(const ov::Output& in, const ov::element::Type& type); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSlice(const ov::Output& in, - const ov::Output& begin, - const ov::Output& end, - const ov::Output& stride, - const ov::Output& axes); +std::shared_ptr makeSlice(const ov::Output& in, + const ov::Output& begin, + const ov::Output& end, + const ov::Output& stride, + const ov::Output& axes); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSlice(const ov::Output& in, - const ov::Output& begin, - const ov::Output& end, - const ov::Output& stride); +std::shared_ptr makeSlice(const ov::Output& in, + const ov::Output& begin, + const ov::Output& end, + const ov::Output& stride); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeMVN(const ov::Output& in, bool acrossChannels, bool normalizeVariance, double eps); +std::shared_ptr makeMVN(const ov::Output& in, + bool acrossChannels, + bool normalizeVariance, + double eps); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeMVN(const ov::Output& in, +std::shared_ptr makeMVN(const ov::Output& in, const ov::AxisSet& axes, bool normalizeVariance, double eps); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeMVN6(const ov::Output& in, - const ov::Output& axesNode, +std::shared_ptr makeMVN6(const ov::Output& in, + const ov::Output& axesNode, bool normalizeVariance, float eps, std::string& epsMode); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeSqueezeUnsqueeze(const ov::Output& in, +std::shared_ptr makeSqueezeUnsqueeze(const ov::Output& in, const ov::element::Type& type, const std::vector& squeeze_indices, ov::test::utils::SqueezeOpType opType); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeMinMax(const ov::Output& in1, - const ov::Output& in2, +std::shared_ptr makeMinMax(const ov::Output& in1, + const ov::Output& in2, ov::test::utils::MinMaxOpType opType); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeProposal(const ov::Output& class_probs, - const ov::Output& class_logits, +std::shared_ptr makeProposal(const ov::Output& class_probs, + const ov::Output& class_logits, const std::vector& image_info, const ov::element::Type& type, size_t base_size, @@ -348,24 +351,24 @@ std::shared_ptr makeProposal(const ov::Output& class_probs, float box_coordinate_scale, std::string framework); -std::shared_ptr makeFakeQuantize(const ov::Output& in, - const ov::element::Type& type, - std::size_t levels, - std::vector constShapes, - const std::vector& inputLowData, - const std::vector& inputHighData, - const std::vector& outputLowData, - const std::vector& outputHighData); +std::shared_ptr makeFakeQuantize(const ov::Output& in, + const ov::element::Type& type, + std::size_t levels, + std::vector constShapes, + const std::vector& inputLowData, + const std::vector& inputHighData, + const std::vector& outputLowData, + const std::vector& outputHighData); -std::shared_ptr makeFakeQuantize(const ov::Output& in, - const ov::element::Type& type, - std::size_t levels, - std::vector constShapes, - const int32_t seed = 1); +std::shared_ptr makeFakeQuantize(const ov::Output& in, + const ov::element::Type& type, + std::size_t levels, + std::vector constShapes, + const int32_t seed = 1); std::shared_ptr makeEmbeddingBagOffsetsSum(const ov::element::Type& dataType, const ov::element::Type& indicesType, - const ov::Output& emb_table_node, + const ov::Output& emb_table_node, const std::vector& indices, const std::vector& offsets, size_t default_index, @@ -374,7 +377,7 @@ std::shared_ptr makeEmbeddingBagOffsetsSum(const ov::element::Type& da std::shared_ptr makeEmbeddingSegmentsSum(const ov::element::Type& dataType, const ov::element::Type& indicesType, - const ov::Output& emb_table_node, + const ov::Output& emb_table_node, const std::vector& indices, const std::vector& segment_ids, size_t num_segments, @@ -382,33 +385,33 @@ std::shared_ptr makeEmbeddingSegmentsSum(const ov::element::Type& data bool with_weights, bool with_default_index); -std::shared_ptr makeReduce(const ov::Output& data, - const ov::Output& axes, +std::shared_ptr makeReduce(const ov::Output& data, + const ov::Output& axes, bool keepDims, ov::test::utils::ReductionType reductionType); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makePooling(const ov::Output& in, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& kernel, - const ov::op::RoundingType& roundingType, - const ov::op::PadType& padType, - bool excludePad, - const ov::test::utils::PoolingTypes& poolType); +std::shared_ptr makePooling(const ov::Output& in, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& kernel, + const ov::op::RoundingType& roundingType, + const ov::op::PadType& padType, + bool excludePad, + const ov::test::utils::PoolingTypes& poolType); -std::shared_ptr makeComparison(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeComparison(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::ComparisonTypes comparisonType); -std::shared_ptr makeLogical(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeLogical(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::LogicalTypes logicalType); std::shared_ptr makeLogical(const ov::ParameterVector& inputs, ov::test::utils::LogicalTypes logicalType); -std::shared_ptr makeFullyConnected(const ov::Output& in, +std::shared_ptr makeFullyConnected(const ov::Output& in, const ov::element::Type& type, const size_t outputSize, bool addBias = true, @@ -417,7 +420,7 @@ std::shared_ptr makeFullyConnected(const ov::Output& in, const std::vector& biasWeights = {}); OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makePad(const ov::Output& data, +std::shared_ptr makePad(const ov::Output& data, const std::vector& padsBegin, const std::vector& padsEnd, float argPadValue, @@ -462,12 +465,12 @@ std::shared_ptr makeRNN( ov::op::RecurrentSequenceDirection direction = ov::op::RecurrentSequenceDirection::FORWARD, ov::test::utils::SequenceTestsMode mode = ov::test::utils::SequenceTestsMode::PURE_SEQ); -std::shared_ptr makeGatherND(const ov::Output& dataNode, +std::shared_ptr makeGatherND(const ov::Output& dataNode, const ov::Shape& indicesShape, const ov::element::Type& indicesType, const std::size_t batchDims); -std::shared_ptr makeGatherND8(const ov::Output& dataNode, +std::shared_ptr makeGatherND8(const ov::Output& dataNode, const ov::Shape& indicesShape, const ov::element::Type& indicesType, const std::size_t batchDims); @@ -475,8 +478,8 @@ std::shared_ptr makeGatherND8(const ov::Output& dataNode, enum class NmsVersion { NmsVersion5, NmsVersion9 }; OPENVINO_DEPRECATED("This function is deprecated and will be removed soon.") -std::shared_ptr makeNms(const ov::Output& boxes, - const ov::Output& scores, +std::shared_ptr makeNms(const ov::Output& boxes, + const ov::Output& scores, const ov::element::Type& maxBoxesPrec, const ov::element::Type& thrPrec, const int32_t& maxOutBoxesPerClass, @@ -488,12 +491,12 @@ std::shared_ptr makeNms(const ov::Output& boxes, const ov::element::Type& outType, const NmsVersion nmsVersion = NmsVersion::NmsVersion5); -std::shared_ptr makeDFT(const ov::Output& dataNode, +std::shared_ptr makeDFT(const ov::Output& dataNode, const std::vector& axes, const std::vector& signalSize, const ov::test::utils::DFTOpType opType); -std::shared_ptr makeRDFT(const ov::Output& dataNode, +std::shared_ptr makeRDFT(const ov::Output& dataNode, const std::vector& axes, const std::vector& signalSize, const ov::test::utils::DFTOpType opType); diff --git a/src/tests/ov_helpers/ov_models/include/ov_models/pass/convert_prc.hpp b/src/tests/ov_helpers/ov_models/include/ov_models/pass/convert_prc.hpp index 0bc2e4b0b04..bf2258bac02 100644 --- a/src/tests/ov_helpers/ov_models/include/ov_models/pass/convert_prc.hpp +++ b/src/tests/ov_helpers/ov_models/include/ov_models/pass/convert_prc.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -50,7 +50,7 @@ template class ConvertParametersPrecision : public ov::pass::MatcherPass { public: ConvertParametersPrecision() { - auto constant = std::make_shared(to, Shape{1}); + auto constant = std::make_shared(to, ov::Shape{1}); ov::matcher_pass_callback callback = [](ov::pass::pattern::Matcher& m) { auto parameter = std::dynamic_pointer_cast(m.get_match_root()); diff --git a/src/tests/ov_helpers/ov_models/ov_builders/src/broadcast.cpp b/src/tests/ov_helpers/ov_models/ov_builders/src/broadcast.cpp index 521aec892c7..ef141f1b259 100644 --- a/src/tests/ov_helpers/ov_models/ov_builders/src/broadcast.cpp +++ b/src/tests/ov_helpers/ov_models/ov_builders/src/broadcast.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2022 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -43,14 +43,14 @@ std::vector get_axes_mapping(const Shape& output_shape, const AxisSet& b /// /// \return The Output object with Node returning axes mapping. /// -Output get_axes_mapping_output(const Shape& output_shape, const AxisSet& broadcast_axes) { +Output get_axes_mapping_output(const Shape& output_shape, const AxisSet& broadcast_axes) { std::vector axes_mapping{get_axes_mapping(output_shape, broadcast_axes)}; return ov::op::v0::Constant::create(ov::element::i64, Shape{axes_mapping.size()}, axes_mapping); } -static Output get_axes_mapping_output(const PartialShape& output_shape, - const Output& input_shape, - std::size_t start_match_axis) { +static Output get_axes_mapping_output(const PartialShape& output_shape, + const Output& input_shape, + std::size_t start_match_axis) { const auto one_node = ov::op::v0::Constant::create(ov::element::i64, Shape{}, {1}); const auto zero_node = ov::op::v0::Constant::create(ov::element::i64, Shape{}, {0}); const auto start_match_axis_node = ov::op::v0::Constant::create(ov::element::i64, Shape{}, {start_match_axis}); @@ -70,14 +70,16 @@ static Output get_axes_mapping_output(const PartialShape& output_shape, } } // namespace -Output make_broadcast(const Output& node, const Shape& target_shape, const AxisSet& broadcast_axes) { +Output make_broadcast(const Output& node, + const Shape& target_shape, + const AxisSet& broadcast_axes) { return std::make_shared( node, ov::op::v0::Constant::create(ov::element::i64, Shape{target_shape.size()}, target_shape), get_axes_mapping_output(target_shape, broadcast_axes)); } -Output make_broadcast(const Output& node, const Shape& target_shape, size_t start_match_axis) { +Output make_broadcast(const Output& node, const Shape& target_shape, size_t start_match_axis) { const auto node_shape = std::make_shared(node); return std::make_shared( node, diff --git a/src/tests/ov_helpers/ov_models/ov_builders/src/norm.cpp b/src/tests/ov_helpers/ov_models/ov_builders/src/norm.cpp index 7719443e4a8..2baba1971d5 100644 --- a/src/tests/ov_helpers/ov_models/ov_builders/src/norm.cpp +++ b/src/tests/ov_helpers/ov_models/ov_builders/src/norm.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2022 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -27,27 +27,27 @@ enum class BiasMode { MAX }; -std::shared_ptr lp_norm(const Output& value, - size_t p_norm, - const Output& reduction_axes, - float bias, - bool keep_dims) { +std::shared_ptr lp_norm(const Output& value, + size_t p_norm, + const Output& reduction_axes, + float bias, + bool keep_dims) { // In general "entrywise" lp-norm for matrix `A` is defined as following double // sum: // ||A||_p = ||vec(A)||_p = [sum_{i=1}^m sum_{j=1}^n abs(a_{i,j})^p]^{1/p} - std::shared_ptr abs_values{std::make_shared(value)}; - std::shared_ptr p_node = ov::op::v0::Constant::create(value.get_element_type(), Shape{}, {p_norm}); + std::shared_ptr abs_values{std::make_shared(value)}; + std::shared_ptr p_node = ov::op::v0::Constant::create(value.get_element_type(), Shape{}, {p_norm}); // Get inner part of equation: abs_values^p_node, then sum over reduction_axes. - std::shared_ptr values{std::make_shared(abs_values, p_node)}; + std::shared_ptr values{std::make_shared(abs_values, p_node)}; values = std::make_shared(values, reduction_axes, keep_dims); - std::shared_ptr bias_node{ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; + std::shared_ptr bias_node{ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; values = std::make_shared(values, bias_node); // Get outer part of equation: raise values to 1/p_norm exponent. - std::shared_ptr inv_p_node = + std::shared_ptr inv_p_node = ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {1.f / p_norm}); return {std::make_shared(values, inv_p_node)}; @@ -64,12 +64,14 @@ std::shared_ptr lp_norm(const Output& value, /// /// \return L-0 norm of value. The output sub-graph is composed of v1 ops. /// -std::shared_ptr l0_norm(const Output& value, const Output& reduction_axes, bool keep_dims) { +std::shared_ptr l0_norm(const Output& value, + const Output& reduction_axes, + bool keep_dims) { // L0 norm returns number of elements different from zero. - const std::shared_ptr zero_node{ov::op::v0::Constant::create(value.get_element_type(), Shape{}, {0.f})}; + const std::shared_ptr zero_node{ov::op::v0::Constant::create(value.get_element_type(), Shape{}, {0.f})}; // Convert bool values to input node data type. - const std::shared_ptr non_zero_values = + const std::shared_ptr non_zero_values = std::make_shared(std::make_shared(value, zero_node), value.get_element_type()); @@ -87,14 +89,15 @@ std::shared_ptr l0_norm(const Output& value, const Output& red /// /// \return L-1 norm of value. The output sub-graph is composed of v1 ops. /// -std::shared_ptr l1_norm(const Output& value, - const Output& reduction_axes, - float bias, - bool keep_dims) { - const std::shared_ptr values{ +std::shared_ptr l1_norm(const Output& value, + const Output& reduction_axes, + float bias, + bool keep_dims) { + const std::shared_ptr values{ std::make_shared(std::make_shared(value), reduction_axes, keep_dims)}; - const std::shared_ptr bias_node{ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; + const std::shared_ptr bias_node{ + ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; return std::make_shared(values, bias_node); } @@ -112,18 +115,18 @@ std::shared_ptr l1_norm(const Output& value, /// /// \return L-2 norm of value. The output sub-graph is composed of v1 ops. /// -std::shared_ptr l2_norm(const Output& value, - const Output& reduction_axes, - float bias, - BiasMode bias_mode, - bool keep_dims) { - std::shared_ptr pow = std::make_shared( +std::shared_ptr l2_norm(const Output& value, + const Output& reduction_axes, + float bias, + BiasMode bias_mode, + bool keep_dims) { + std::shared_ptr pow = std::make_shared( value, std::make_shared(value.get_element_type(), Shape{}, 2)); - std::shared_ptr values{std::make_shared(pow, reduction_axes, keep_dims)}; + std::shared_ptr values{std::make_shared(pow, reduction_axes, keep_dims)}; - std::shared_ptr bias_node{ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; - std::shared_ptr result; + std::shared_ptr bias_node{ov::op::v0::Constant::create(values->get_element_type(), Shape{}, {bias})}; + std::shared_ptr result; switch (bias_mode) { case BiasMode::MAX: { result = std::make_shared(std::make_shared(values, bias_node)); @@ -137,11 +140,11 @@ std::shared_ptr l2_norm(const Output& value, } } // namespace -std::shared_ptr lp_norm(const Output& value, - const Output& reduction_axes, - size_t p_norm, - float bias, - bool keep_dims) { +std::shared_ptr lp_norm(const Output& value, + const Output& reduction_axes, + size_t p_norm, + float bias, + bool keep_dims) { // The number of non-zero elements if (p_norm == 0) { return l0_norm(value, reduction_axes, keep_dims); diff --git a/src/tests/ov_helpers/ov_models/ov_builders/src/reshape.cpp b/src/tests/ov_helpers/ov_models/ov_builders/src/reshape.cpp index 0766df37cae..64886c9f1a4 100644 --- a/src/tests/ov_helpers/ov_models/ov_builders/src/reshape.cpp +++ b/src/tests/ov_helpers/ov_models/ov_builders/src/reshape.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2022 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -22,7 +22,7 @@ namespace ov { namespace op { namespace util { -std::shared_ptr reshape(const Output& value, const Shape& shape) { +std::shared_ptr reshape(const Output& value, const Shape& shape) { if (value.get_partial_shape().same_scheme(shape)) { return value.get_node_shared_ptr(); } else if (is_scalar(shape)) { @@ -40,7 +40,7 @@ std::shared_ptr reshape(const Output& value, const Shape& shape) { } } -std::shared_ptr reorder_axes(const Output& value, std::vector axes_order) { +std::shared_ptr reorder_axes(const Output& value, std::vector axes_order) { const auto axes_order_const = ov::op::v0::Constant::create(ov::element::i64, Shape{axes_order.size()}, @@ -48,7 +48,7 @@ std::shared_ptr reorder_axes(const Output& value, std::vector(value, axes_order_const); } -std::shared_ptr transpose(const Output& value) { +std::shared_ptr transpose(const Output& value) { // This part is left to preserve backward compatibility and ensure passing ONNX tests. if (value.get_partial_shape().is_static()) { std::vector axes_order(value.get_shape().size()); @@ -76,7 +76,7 @@ namespace { /// /// \return The new Constant node representing normalized axis value. /// -std::shared_ptr get_normalized_axis_node(const std::shared_ptr node_rank, int64_t axis) { +std::shared_ptr get_normalized_axis_node(const std::shared_ptr node_rank, int64_t axis) { auto axis_node = ov::op::v0::Constant::create(ov::element::i64, Shape{1}, {axis}); // shortcut for already positive value if (axis >= 0) { @@ -89,11 +89,11 @@ std::shared_ptr get_normalized_axis_node(const std::shared_ptr node_ } } // namespace -std::shared_ptr flatten(const Output& value, int axis) { +std::shared_ptr flatten(const Output& value, int axis) { // First dimension of output tensor is the product of [d_0, ... d_{axis-1}] dimensions of // input tensor. The last dimension is the product of the rest of input tensor dimensions: // [d_{axis}, ..., d_n] - std::shared_ptr output_shape; + std::shared_ptr output_shape; if (axis == 0) { output_shape = ov::op::v0::Constant::create(ov::element::i64, Shape{2}, {1, -1}); } else if (axis == 1) { diff --git a/src/tests/ov_helpers/ov_models/ov_builders/src/split.cpp b/src/tests/ov_helpers/ov_models/ov_builders/src/split.cpp index 3a154ecb4f5..fadd4afd8f0 100644 --- a/src/tests/ov_helpers/ov_models/ov_builders/src/split.cpp +++ b/src/tests/ov_helpers/ov_models/ov_builders/src/split.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2022 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,7 +11,7 @@ namespace ov { namespace op { namespace util { -OutputVector split(const Output& value, const std::vector& split_lengths, int64_t axis) { +OutputVector split(const Output& value, const std::vector& split_lengths, int64_t axis) { const auto axis_node = ov::op::v0::Constant::create(ov::element::i64, Shape{}, {axis}); const auto split_lengths_node = ov::op::v0::Constant::create(ov::element::i64, Shape{split_lengths.size()}, split_lengths); @@ -20,7 +20,7 @@ OutputVector split(const Output& value, const std::vector& split_ return variadic_split->outputs(); } -OutputVector split(const Output& value, int64_t num_splits, int64_t axis) { +OutputVector split(const Output& value, int64_t num_splits, int64_t axis) { const auto axis_node = ov::op::v0::Constant::create(ov::element::i64, Shape{}, {axis}); const auto split = std::make_shared(value, axis_node, num_splits); diff --git a/src/tests/ov_helpers/ov_models/src/activation.cpp b/src/tests/ov_helpers/ov_models/src/activation.cpp index 4d246b0f6b3..5282048fe91 100644 --- a/src/tests/ov_helpers/ov_models/src/activation.cpp +++ b/src/tests/ov_helpers/ov_models/src/activation.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -50,7 +50,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeActivation(const ov::Output& in, +std::shared_ptr makeActivation(const ov::Output& in, const ov::element::Type& type, ov::test::utils::ActivationTypes activationType, std::vector inShape, diff --git a/src/tests/ov_helpers/ov_models/src/batch_to_space.cpp b/src/tests/ov_helpers/ov_models/src/batch_to_space.cpp index 2e08f8219e5..f71e8dfd069 100644 --- a/src/tests/ov_helpers/ov_models/src/batch_to_space.cpp +++ b/src/tests/ov_helpers/ov_models/src/batch_to_space.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,7 +9,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeBatchToSpace(const ov::Output& in, +std::shared_ptr makeBatchToSpace(const ov::Output& in, const ov::element::Type& type, const std::vector& blockShape, const std::vector& cropsBegin, diff --git a/src/tests/ov_helpers/ov_models/src/binary_convolution.cpp b/src/tests/ov_helpers/ov_models/src/binary_convolution.cpp index fc8703ebd29..8e5123a8153 100644 --- a/src/tests/ov_helpers/ov_models/src/binary_convolution.cpp +++ b/src/tests/ov_helpers/ov_models/src/binary_convolution.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,16 +13,16 @@ namespace ngraph { namespace builder { -std::shared_ptr makeBinaryConvolution(const ov::Output& in, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - float padValue, - const std::vector& filterWeihgts) { +std::shared_ptr makeBinaryConvolution(const ov::Output& in, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + float padValue, + const std::vector& filterWeihgts) { auto shape = in.get_shape(); std::vector filterWeightsShape = {numOutChannels, shape[1]}; filterWeightsShape.insert(filterWeightsShape.end(), filterSize.begin(), filterSize.end()); diff --git a/src/tests/ov_helpers/ov_models/src/comparison.cpp b/src/tests/ov_helpers/ov_models/src/comparison.cpp index 3f823a79d79..e573e7b73ae 100644 --- a/src/tests/ov_helpers/ov_models/src/comparison.cpp +++ b/src/tests/ov_helpers/ov_models/src/comparison.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,8 +10,8 @@ namespace ngraph { namespace builder { -std::shared_ptr makeComparison(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeComparison(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::ComparisonTypes comparisonType) { switch (comparisonType) { case ov::test::utils::ComparisonTypes::EQUAL: diff --git a/src/tests/ov_helpers/ov_models/src/convolution.cpp b/src/tests/ov_helpers/ov_models/src/convolution.cpp index a1617e6ea96..2bdc11ce221 100644 --- a/src/tests/ov_helpers/ov_models/src/convolution.cpp +++ b/src/tests/ov_helpers/ov_models/src/convolution.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -14,18 +14,18 @@ namespace ngraph { namespace builder { -std::shared_ptr makeConvolution(const ov::Output& in, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - bool addBiases, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeConvolution(const ov::Output& in, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + bool addBiases, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {numOutChannels, static_cast(shape[1].get_length())}; @@ -50,18 +50,18 @@ std::shared_ptr makeConvolution(const ov::Output& in, } } -std::shared_ptr makeConvolution(const ov::Output& in_data, - const ov::Output& in_weights, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - bool addBiases, - const std::vector& biasesWeights) { +std::shared_ptr makeConvolution(const ov::Output& in_data, + const ov::Output& in_weights, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + bool addBiases, + const std::vector& biasesWeights) { auto shape = in_data.get_partial_shape(); auto conv = std::make_shared(in_data, in_weights, strides, padsBegin, padsEnd, dilations, autoPad); diff --git a/src/tests/ov_helpers/ov_models/src/convolution_backprop_data.cpp b/src/tests/ov_helpers/ov_models/src/convolution_backprop_data.cpp index 14234d71076..02c7e2d705b 100644 --- a/src/tests/ov_helpers/ov_models/src/convolution_backprop_data.cpp +++ b/src/tests/ov_helpers/ov_models/src/convolution_backprop_data.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,19 +13,19 @@ namespace ngraph { namespace builder { -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - bool addBiases, - const std::vector& outputPadding, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + bool addBiases, + const std::vector& outputPadding, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {static_cast(shape[1].get_length()), numOutChannels}; @@ -46,17 +46,17 @@ std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, biasesWeights); } -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, - const ov::Output& weights, - const ov::element::Type& type, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - bool addBiases, - const std::vector& outputPadding, - const std::vector& biasesWeights) { +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, + const ov::Output& weights, + const ov::element::Type& type, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + bool addBiases, + const std::vector& outputPadding, + const std::vector& biasesWeights) { auto deconv = std::make_shared(in, weights, strides, @@ -86,20 +86,20 @@ std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, } } -std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, - const ov::Output& outputShape, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - bool addBiases, - const std::vector& outputPadding, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeConvolutionBackpropData(const ov::Output& in, + const ov::Output& outputShape, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + bool addBiases, + const std::vector& outputPadding, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {static_cast(shape[1].get_length()), numOutChannels}; diff --git a/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder.cpp b/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder.cpp index ae281b1d268..dc8ce10f0f3 100644 --- a/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder.cpp +++ b/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,7 +13,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeCTCGreedyDecoder(const ov::Output& inputData, const bool mergeRepeated) { +std::shared_ptr makeCTCGreedyDecoder(const ov::Output& inputData, const bool mergeRepeated) { auto inputDataShape = inputData.get_shape(); size_t T = inputDataShape[0]; size_t B = inputDataShape[1]; diff --git a/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder_seq_len.cpp b/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder_seq_len.cpp index 34b75a96e90..e2626029b68 100644 --- a/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder_seq_len.cpp +++ b/src/tests/ov_helpers/ov_models/src/ctc_greedy_decoder_seq_len.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,8 +13,8 @@ namespace ngraph { namespace builder { -std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, - const ov::Output& sequenceLengthData, +std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, + const ov::Output& sequenceLengthData, int32_t blankIndex, bool mergeRepeated, const ov::element::Type& idxPrecision) { @@ -37,7 +37,7 @@ std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inp idxPrecision); } -std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, +std::shared_ptr makeCTCGreedyDecoderSeqLen(const ov::Output& inputData, int32_t blankIndex, bool mergeRepeated, const ov::element::Type& idxPrecision) { diff --git a/src/tests/ov_helpers/ov_models/src/ctc_loss.cpp b/src/tests/ov_helpers/ov_models/src/ctc_loss.cpp index 768071ed174..91abb6dfa21 100644 --- a/src/tests/ov_helpers/ov_models/src/ctc_loss.cpp +++ b/src/tests/ov_helpers/ov_models/src/ctc_loss.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,16 +13,16 @@ namespace ngraph { namespace builder { -std::shared_ptr makeCTCLoss(const ov::Output& logitsNode, - std::vector& logitsLength, - std::vector>& labels, - std::vector& labelsLength, - int blankIndex, - const ov::element::Type& fType, - const ov::element::Type& iType, - const bool preprocessCollapseRepeated, - const bool ctcMergeRepeated, - const bool unique) { +std::shared_ptr makeCTCLoss(const ov::Output& logitsNode, + std::vector& logitsLength, + std::vector>& labels, + std::vector& labelsLength, + int blankIndex, + const ov::element::Type& fType, + const ov::element::Type& iType, + const bool preprocessCollapseRepeated, + const bool ctcMergeRepeated, + const bool unique) { auto logitsShape = logitsNode.get_shape(); size_t N = logitsShape[0]; size_t T = logitsShape[1]; diff --git a/src/tests/ov_helpers/ov_models/src/dft.cpp b/src/tests/ov_helpers/ov_models/src/dft.cpp index ca2dd047962..ccae4463eb9 100644 --- a/src/tests/ov_helpers/ov_models/src/dft.cpp +++ b/src/tests/ov_helpers/ov_models/src/dft.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -27,7 +27,7 @@ std::shared_ptr CallDftCtorWithArgs(const ov::test::utils::DFTOpType o } } // namespace -std::shared_ptr makeDFT(const ov::Output& dataNode, +std::shared_ptr makeDFT(const ov::Output& dataNode, const std::vector& axes, const std::vector& signalSize, const ov::test::utils::DFTOpType opType) { diff --git a/src/tests/ov_helpers/ov_models/src/eltwise.cpp b/src/tests/ov_helpers/ov_models/src/eltwise.cpp index c5892b9600a..576ad6ccf49 100644 --- a/src/tests/ov_helpers/ov_models/src/eltwise.cpp +++ b/src/tests/ov_helpers/ov_models/src/eltwise.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,8 +11,8 @@ namespace ngraph { namespace builder { -std::shared_ptr makeEltwise(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeEltwise(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::EltwiseTypes eltwiseType) { switch (eltwiseType) { case ov::test::utils::EltwiseTypes::ADD: @@ -48,4 +48,4 @@ std::shared_ptr makeEltwise(const ov::Output& in0, } } // namespace builder -} // namespace ngraph \ No newline at end of file +} // namespace ngraph diff --git a/src/tests/ov_helpers/ov_models/src/embedding_bag_offsets_sum.cpp b/src/tests/ov_helpers/ov_models/src/embedding_bag_offsets_sum.cpp index 0fe0eb4677c..278630c93d0 100644 --- a/src/tests/ov_helpers/ov_models/src/embedding_bag_offsets_sum.cpp +++ b/src/tests/ov_helpers/ov_models/src/embedding_bag_offsets_sum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,20 +12,20 @@ namespace ngraph { namespace builder { -std::shared_ptr makeEmbeddingBagOffsetsSum(const ov::element::Type& dataType, - const ov::element::Type& indicesType, - const ov::Output& embTableNode, - const std::vector& indices, - const std::vector& offsets, - size_t default_index, - bool with_weights, - bool with_default_index) { +std::shared_ptr makeEmbeddingBagOffsetsSum(const ov::element::Type& dataType, + const ov::element::Type& indicesType, + const ov::Output& embTableNode, + const std::vector& indices, + const std::vector& offsets, + size_t default_index, + bool with_weights, + bool with_default_index) { std::vector i_shape = {indices.size()}; auto indicesNode = std::make_shared(indicesType, i_shape, indices); std::vector o_shape = {offsets.size()}; auto offsetsNode = std::make_shared(indicesType, o_shape, offsets); - std::shared_ptr embBag; + std::shared_ptr embBag; if (with_default_index) { std::vector d_shape = {}; auto defIdxNode = std::make_shared(indicesType, d_shape, default_index); diff --git a/src/tests/ov_helpers/ov_models/src/embedding_segments_sum.cpp b/src/tests/ov_helpers/ov_models/src/embedding_segments_sum.cpp index e700375e364..fefd6be6fcb 100644 --- a/src/tests/ov_helpers/ov_models/src/embedding_segments_sum.cpp +++ b/src/tests/ov_helpers/ov_models/src/embedding_segments_sum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,15 +13,15 @@ namespace ngraph { namespace builder { -std::shared_ptr makeEmbeddingSegmentsSum(const ov::element::Type& dataType, - const ov::element::Type& indicesType, - const ov::Output& embTableNode, - const std::vector& indices, - const std::vector& segment_ids, - size_t num_segments, - size_t default_index, - bool with_weights, - bool with_default_index) { +std::shared_ptr makeEmbeddingSegmentsSum(const ov::element::Type& dataType, + const ov::element::Type& indicesType, + const ov::Output& embTableNode, + const std::vector& indices, + const std::vector& segment_ids, + size_t num_segments, + size_t default_index, + bool with_weights, + bool with_default_index) { std::vector i_shape = {indices.size()}; auto indicesNode = std::make_shared(indicesType, i_shape, indices); std::vector o_shape = {segment_ids.size()}; @@ -29,7 +29,7 @@ std::shared_ptr makeEmbeddingSegmentsSum(const ov::element::Type& dataType std::vector shape_0 = {}; auto segmentNumNode = std::make_shared(indicesType, shape_0, num_segments); - std::shared_ptr embBag; + std::shared_ptr embBag; if (with_default_index) { auto defIdxNode = std::make_shared(indicesType, shape_0, default_index); if (with_weights) { diff --git a/src/tests/ov_helpers/ov_models/src/fake_quantize.cpp b/src/tests/ov_helpers/ov_models/src/fake_quantize.cpp index 514c75728ae..13dd5262954 100644 --- a/src/tests/ov_helpers/ov_models/src/fake_quantize.cpp +++ b/src/tests/ov_helpers/ov_models/src/fake_quantize.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,14 +13,14 @@ namespace ngraph { namespace builder { -std::shared_ptr makeFakeQuantize(const ov::Output& in, - const ov::element::Type& constantType, - std::size_t levels, - std::vector constShapes, - const std::vector& inputLowData, - const std::vector& inputHighData, - const std::vector& outputLowData, - const std::vector& outputHighData) { +std::shared_ptr makeFakeQuantize(const ov::Output& in, + const ov::element::Type& constantType, + std::size_t levels, + std::vector constShapes, + const std::vector& inputLowData, + const std::vector& inputHighData, + const std::vector& outputLowData, + const std::vector& outputHighData) { auto inputLowNode = ov::test::utils::deprecated::make_constant(constantType, constShapes, inputLowData, inputLowData.empty()); auto inputHighNode = diff --git a/src/tests/ov_helpers/ov_models/src/fully_connected.cpp b/src/tests/ov_helpers/ov_models/src/fully_connected.cpp index f5da3e34312..375e5c5e99b 100644 --- a/src/tests/ov_helpers/ov_models/src/fully_connected.cpp +++ b/src/tests/ov_helpers/ov_models/src/fully_connected.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,13 +13,13 @@ namespace ngraph { namespace builder { -std::shared_ptr makeFullyConnected(const ov::Output& in, - const ov::element::Type& type, - const size_t outputSize, - bool addBias, - const ov::Shape& weightsShape, - const std::vector& weights, - const std::vector& biasWeights) { +std::shared_ptr makeFullyConnected(const ov::Output& in, + const ov::element::Type& type, + const size_t outputSize, + bool addBias, + const ov::Shape& weightsShape, + const std::vector& weights, + const std::vector& biasWeights) { auto shape = weightsShape; if (shape.empty()) { auto inputShape = in.get_shape(); diff --git a/src/tests/ov_helpers/ov_models/src/gather_nd.cpp b/src/tests/ov_helpers/ov_models/src/gather_nd.cpp index 1d3493ada88..48dcfb5e5f1 100644 --- a/src/tests/ov_helpers/ov_models/src/gather_nd.cpp +++ b/src/tests/ov_helpers/ov_models/src/gather_nd.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,10 +13,10 @@ namespace ngraph { namespace builder { -std::shared_ptr makeGatherND(const ov::Output& dataNode, - const ov::Shape& indicesShape, - const ov::element::Type& indicesType, - const std::size_t batchDims) { +std::shared_ptr makeGatherND(const ov::Output& dataNode, + const ov::Shape& indicesShape, + const ov::element::Type& indicesType, + const std::size_t batchDims) { const auto indices = [&] { const auto& dataShape = dataNode.get_shape(); const auto indicesCount = @@ -43,10 +43,10 @@ std::shared_ptr makeGatherND(const ov::Output& dataNode, return gatherNdNode; } -std::shared_ptr makeGatherND8(const ov::Output& dataNode, - const ov::Shape& indicesShape, - const ov::element::Type& indicesType, - const std::size_t batchDims) { +std::shared_ptr makeGatherND8(const ov::Output& dataNode, + const ov::Shape& indicesShape, + const ov::element::Type& indicesType, + const std::size_t batchDims) { const auto indices = [&] { const auto& dataShape = dataNode.get_shape(); const auto indicesCount = diff --git a/src/tests/ov_helpers/ov_models/src/group_convolution.cpp b/src/tests/ov_helpers/ov_models/src/group_convolution.cpp index 4996137128d..6e2a221b699 100644 --- a/src/tests/ov_helpers/ov_models/src/group_convolution.cpp +++ b/src/tests/ov_helpers/ov_models/src/group_convolution.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,19 +13,19 @@ namespace ngraph { namespace builder { -std::shared_ptr makeGroupConvolution(const ov::Output& in, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - size_t numGroups, - bool addBiases, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeGroupConvolution(const ov::Output& in, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + size_t numGroups, + bool addBiases, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {numOutChannels, static_cast(shape[1].get_length())}; @@ -50,16 +50,16 @@ std::shared_ptr makeGroupConvolution(const ov::Output& in, biasesWeights); } -std::shared_ptr makeGroupConvolution(const ov::Output& in, - const ov::Output& weights, - const ov::element::Type& type, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - bool addBiases, - const std::vector& biasesWeights) { +std::shared_ptr makeGroupConvolution(const ov::Output& in, + const ov::Output& weights, + const ov::element::Type& type, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + bool addBiases, + const std::vector& biasesWeights) { auto conv = std::make_shared(in, weights, strides, padsBegin, padsEnd, dilations, autoPad); if (addBiases) { diff --git a/src/tests/ov_helpers/ov_models/src/group_convolution_backprop_data.cpp b/src/tests/ov_helpers/ov_models/src/group_convolution_backprop_data.cpp index 3f85d358e1c..c4ca29863ea 100644 --- a/src/tests/ov_helpers/ov_models/src/group_convolution_backprop_data.cpp +++ b/src/tests/ov_helpers/ov_models/src/group_convolution_backprop_data.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,20 +13,20 @@ namespace ngraph { namespace builder { -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - size_t numGroups, - bool addBiases, - const std::vector& outputPadding, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + size_t numGroups, + bool addBiases, + const std::vector& outputPadding, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {static_cast(shape[1].get_length()), numOutChannels}; @@ -52,17 +52,17 @@ std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& i biasesWeights); } -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, - const ov::Output& weights, - const ov::element::Type& type, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - bool addBiases, - const std::vector& outputPadding, - const std::vector& biasesWeights) { +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, + const ov::Output& weights, + const ov::element::Type& type, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + bool addBiases, + const std::vector& outputPadding, + const std::vector& biasesWeights) { auto deconv = std::make_shared(in, weights, strides, @@ -91,21 +91,21 @@ std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& i } } -std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, - const ov::Output& outputShape, - const ov::element::Type& type, - const std::vector& filterSize, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& dilations, - const ov::op::PadType& autoPad, - size_t numOutChannels, - size_t numGroups, - bool addBiases, - const std::vector& outputPadding, - const std::vector& filterWeights, - const std::vector& biasesWeights) { +std::shared_ptr makeGroupConvolutionBackpropData(const ov::Output& in, + const ov::Output& outputShape, + const ov::element::Type& type, + const std::vector& filterSize, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& dilations, + const ov::op::PadType& autoPad, + size_t numOutChannels, + size_t numGroups, + bool addBiases, + const std::vector& outputPadding, + const std::vector& filterWeights, + const std::vector& biasesWeights) { bool randomFilterWeights = filterWeights.empty(); auto shape = in.get_partial_shape(); std::vector filterWeightsShape = {static_cast(shape[1].get_length()), numOutChannels}; diff --git a/src/tests/ov_helpers/ov_models/src/gru_cell.cpp b/src/tests/ov_helpers/ov_models/src/gru_cell.cpp index f030a692cb1..d754e096e3e 100644 --- a/src/tests/ov_helpers/ov_models/src/gru_cell.cpp +++ b/src/tests/ov_helpers/ov_models/src/gru_cell.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -57,7 +57,7 @@ std::shared_ptr makeGRU(const ov::OutputVector& in, clip, linear_before_reset); } else { - std::shared_ptr seq_lengths; + std::shared_ptr seq_lengths; switch (mode) { case ov::test::utils::SequenceTestsMode::PURE_SEQ: case ov::test::utils::SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_CONST: { diff --git a/src/tests/ov_helpers/ov_models/src/logical.cpp b/src/tests/ov_helpers/ov_models/src/logical.cpp index e8fb6a56c01..d7f0df22b27 100644 --- a/src/tests/ov_helpers/ov_models/src/logical.cpp +++ b/src/tests/ov_helpers/ov_models/src/logical.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -10,8 +10,8 @@ namespace ngraph { namespace builder { -std::shared_ptr makeLogical(const ov::Output& in0, - const ov::Output& in1, +std::shared_ptr makeLogical(const ov::Output& in0, + const ov::Output& in1, ov::test::utils::LogicalTypes logicalType) { switch (logicalType) { case ov::test::utils::LogicalTypes::LOGICAL_AND: diff --git a/src/tests/ov_helpers/ov_models/src/lstm_cell.cpp b/src/tests/ov_helpers/ov_models/src/lstm_cell.cpp index e9a586d3faf..425f7d5a04e 100644 --- a/src/tests/ov_helpers/ov_models/src/lstm_cell.cpp +++ b/src/tests/ov_helpers/ov_models/src/lstm_cell.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,7 +12,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeLSTM(const std::vector>& in, +std::shared_ptr makeLSTM(const std::vector>& in, const std::vector& constants, std::size_t hidden_size, const std::vector& activations, @@ -76,7 +76,7 @@ std::shared_ptr makeLSTM(const std::vector>& in, activations, clip); } else { - std::shared_ptr seq_lengths; + std::shared_ptr seq_lengths; switch (mode) { case ov::test::utils::SequenceTestsMode::PURE_SEQ: case ov::test::utils::SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_CONST: { diff --git a/src/tests/ov_helpers/ov_models/src/minimum_maximum.cpp b/src/tests/ov_helpers/ov_models/src/minimum_maximum.cpp index e14274953ac..09ff33ac730 100644 --- a/src/tests/ov_helpers/ov_models/src/minimum_maximum.cpp +++ b/src/tests/ov_helpers/ov_models/src/minimum_maximum.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,8 +9,8 @@ namespace ngraph { namespace builder { -std::shared_ptr makeMinMax(const ov::Output& in1, - const ov::Output& in2, +std::shared_ptr makeMinMax(const ov::Output& in1, + const ov::Output& in2, ov::test::utils::MinMaxOpType opType) { switch (opType) { case ov::test::utils::MinMaxOpType::MINIMUM: diff --git a/src/tests/ov_helpers/ov_models/src/mvn.cpp b/src/tests/ov_helpers/ov_models/src/mvn.cpp index a55bbec6dbc..8c850fcab1f 100644 --- a/src/tests/ov_helpers/ov_models/src/mvn.cpp +++ b/src/tests/ov_helpers/ov_models/src/mvn.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,7 +9,10 @@ namespace ngraph { namespace builder { -std::shared_ptr makeMVN(const ov::Output& in, bool acrossChannels, bool normalizeVariance, double eps) { +std::shared_ptr makeMVN(const ov::Output& in, + bool acrossChannels, + bool normalizeVariance, + double eps) { auto mvnNode = std::make_shared(in, acrossChannels, normalizeVariance, eps); // OpenVINO MVN implementation implicitly adds 0th dimension to reduction axes set which is not valid behavior @@ -23,7 +26,7 @@ std::shared_ptr makeMVN(const ov::Output& in, bool acrossChannel return mvnNode; } -std::shared_ptr makeMVN(const ov::Output& in, +std::shared_ptr makeMVN(const ov::Output& in, const ov::AxisSet& axes, bool normalizeVariance, double eps) { @@ -32,11 +35,11 @@ std::shared_ptr makeMVN(const ov::Output& in, return mvnNode; } -std::shared_ptr makeMVN6(const ov::Output& in, - const ov::Output& axesNode, - bool normalizeVariance, - float eps, - std::string& epsMode) { +std::shared_ptr makeMVN6(const ov::Output& in, + const ov::Output& axesNode, + bool normalizeVariance, + float eps, + std::string& epsMode) { ov::op::MVNEpsMode nEpsMode = ov::op::MVNEpsMode::INSIDE_SQRT; if (epsMode == "outside_sqrt") nEpsMode = ov::op::MVNEpsMode::OUTSIDE_SQRT; diff --git a/src/tests/ov_helpers/ov_models/src/non_max_suppression.cpp b/src/tests/ov_helpers/ov_models/src/non_max_suppression.cpp index d318bed19e8..5f45374b3bc 100644 --- a/src/tests/ov_helpers/ov_models/src/non_max_suppression.cpp +++ b/src/tests/ov_helpers/ov_models/src/non_max_suppression.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,8 +11,8 @@ namespace ngraph { namespace builder { template -std::shared_ptr makeNms(const ov::Output& boxes, - const ov::Output& scores, +std::shared_ptr makeNms(const ov::Output& boxes, + const ov::Output& scores, const ov::element::Type& maxBoxesPrec, const ov::element::Type& thrPrec, const int32_t& maxOutBoxesPerClass, @@ -46,8 +46,8 @@ std::shared_ptr makeNms(const ov::Output& boxes, outType); } -std::shared_ptr makeNms(const ov::Output& boxes, - const ov::Output& scores, +std::shared_ptr makeNms(const ov::Output& boxes, + const ov::Output& scores, const ov::element::Type& maxBoxesPrec, const ov::element::Type& thrPrec, const int32_t& maxOutBoxesPerClass, diff --git a/src/tests/ov_helpers/ov_models/src/pad.cpp b/src/tests/ov_helpers/ov_models/src/pad.cpp index ddb226d130e..49544a98c51 100644 --- a/src/tests/ov_helpers/ov_models/src/pad.cpp +++ b/src/tests/ov_helpers/ov_models/src/pad.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,7 +11,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makePad(const ov::Output& data, +std::shared_ptr makePad(const ov::Output& data, const std::vector& padsBegin, const std::vector& padsEnd, float argPadValue, diff --git a/src/tests/ov_helpers/ov_models/src/pooling.cpp b/src/tests/ov_helpers/ov_models/src/pooling.cpp index ba611099b2d..6429ce6784b 100644 --- a/src/tests/ov_helpers/ov_models/src/pooling.cpp +++ b/src/tests/ov_helpers/ov_models/src/pooling.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,15 +12,15 @@ namespace ngraph { namespace builder { -std::shared_ptr makePooling(const ov::Output& in, - const std::vector& strides, - const std::vector& padsBegin, - const std::vector& padsEnd, - const std::vector& kernel, - const ov::op::RoundingType& roundingType, - const ov::op::PadType& padType, - bool excludePad, - const ov::test::utils::PoolingTypes& poolType) { +std::shared_ptr makePooling(const ov::Output& in, + const std::vector& strides, + const std::vector& padsBegin, + const std::vector& padsEnd, + const std::vector& kernel, + const ov::op::RoundingType& roundingType, + const ov::op::PadType& padType, + bool excludePad, + const ov::test::utils::PoolingTypes& poolType) { std::shared_ptr pooling; switch (poolType) { case ov::test::utils::PoolingTypes::MAX: diff --git a/src/tests/ov_helpers/ov_models/src/proposal.cpp b/src/tests/ov_helpers/ov_models/src/proposal.cpp index 801bb6228f5..fbb5455bbd0 100644 --- a/src/tests/ov_helpers/ov_models/src/proposal.cpp +++ b/src/tests/ov_helpers/ov_models/src/proposal.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -13,24 +13,24 @@ namespace ngraph { namespace builder { -std::shared_ptr makeProposal(const ov::Output& class_probs, - const ov::Output& class_logits, - const std::vector& image_info, - const ov::element::Type& type, - size_t base_size, - size_t pre_nms_topn, - size_t post_nms_topn, - float nms_thresh, - size_t feat_stride, - size_t min_size, - const std::vector& ratio, - const std::vector& scale, - bool clip_before_nms, - bool clip_after_nms, - bool normalize, - float box_size_scale, - float box_coordinate_scale, - std::string framework) { +std::shared_ptr makeProposal(const ov::Output& class_probs, + const ov::Output& class_logits, + const std::vector& image_info, + const ov::element::Type& type, + size_t base_size, + size_t pre_nms_topn, + size_t post_nms_topn, + float nms_thresh, + size_t feat_stride, + size_t min_size, + const std::vector& ratio, + const std::vector& scale, + bool clip_before_nms, + bool clip_after_nms, + bool normalize, + float box_size_scale, + float box_coordinate_scale, + std::string framework) { ov::op::v4::Proposal::Attributes attrs; attrs.base_size = base_size; attrs.pre_nms_topn = pre_nms_topn; diff --git a/src/tests/ov_helpers/ov_models/src/rdft.cpp b/src/tests/ov_helpers/ov_models/src/rdft.cpp index 7e67180eab7..eb7667fdcc0 100644 --- a/src/tests/ov_helpers/ov_models/src/rdft.cpp +++ b/src/tests/ov_helpers/ov_models/src/rdft.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -29,7 +29,7 @@ std::shared_ptr CallDftCtorWithArgs(const ov::test::utils::DFTOpType o } } // namespace -std::shared_ptr makeRDFT(const ov::Output& dataNode, +std::shared_ptr makeRDFT(const ov::Output& dataNode, const std::vector& axes, const std::vector& signalSize, const ov::test::utils::DFTOpType opType) { diff --git a/src/tests/ov_helpers/ov_models/src/rnn_cell.cpp b/src/tests/ov_helpers/ov_models/src/rnn_cell.cpp index 8a87aec5cb5..377ce46c023 100644 --- a/src/tests/ov_helpers/ov_models/src/rnn_cell.cpp +++ b/src/tests/ov_helpers/ov_models/src/rnn_cell.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -54,7 +54,7 @@ std::shared_ptr makeRNN(const ov::OutputVector& in, activations_beta, clip); } else { - std::shared_ptr seq_lengths; + std::shared_ptr seq_lengths; switch (mode) { case ov::test::utils::SequenceTestsMode::PURE_SEQ: case ov::test::utils::SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_CONST: { diff --git a/src/tests/ov_helpers/ov_models/src/space_to_batch.cpp b/src/tests/ov_helpers/ov_models/src/space_to_batch.cpp index 30bdfd87fc3..88466c6de7e 100644 --- a/src/tests/ov_helpers/ov_models/src/space_to_batch.cpp +++ b/src/tests/ov_helpers/ov_models/src/space_to_batch.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,7 +9,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeSpaceToBatch(const ov::Output& in, +std::shared_ptr makeSpaceToBatch(const ov::Output& in, const ov::element::Type& type, const std::vector& blockShape, const std::vector& padsBegin, diff --git a/src/tests/ov_helpers/ov_models/src/split.cpp b/src/tests/ov_helpers/ov_models/src/split.cpp index 2a78f8e5a8a..ed282d65bfc 100644 --- a/src/tests/ov_helpers/ov_models/src/split.cpp +++ b/src/tests/ov_helpers/ov_models/src/split.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -11,7 +11,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeSplit(const ov::Output& in, +std::shared_ptr makeSplit(const ov::Output& in, const ov::element::Type& type, size_t numSplits, int64_t axis) { diff --git a/src/tests/ov_helpers/ov_models/src/squeeze_unsqueeze.cpp b/src/tests/ov_helpers/ov_models/src/squeeze_unsqueeze.cpp index 6c77012b02a..02384aac5b4 100644 --- a/src/tests/ov_helpers/ov_models/src/squeeze_unsqueeze.cpp +++ b/src/tests/ov_helpers/ov_models/src/squeeze_unsqueeze.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -12,7 +12,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeSqueezeUnsqueeze(const ov::Output& in, +std::shared_ptr makeSqueezeUnsqueeze(const ov::Output& in, const ov::element::Type& type, const std::vector& squeeze_indices, ov::test::utils::SqueezeOpType opType) { diff --git a/src/tests/ov_helpers/ov_models/src/strided_slice.cpp b/src/tests/ov_helpers/ov_models/src/strided_slice.cpp index e617e23ed3c..676691e4289 100644 --- a/src/tests/ov_helpers/ov_models/src/strided_slice.cpp +++ b/src/tests/ov_helpers/ov_models/src/strided_slice.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2023 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -9,7 +9,7 @@ namespace ngraph { namespace builder { -std::shared_ptr makeSlice(const ov::Output& in, +std::shared_ptr makeSlice(const ov::Output& in, const std::vector& begin, const std::vector& end, const std::vector& stride, @@ -27,18 +27,18 @@ std::shared_ptr makeSlice(const ov::Output& in, } } -std::shared_ptr makeSlice(const ov::Output& in, - const ov::Output& begin, - const ov::Output& end, - const ov::Output& stride, - const ov::Output& axes) { +std::shared_ptr makeSlice(const ov::Output& in, + const ov::Output& begin, + const ov::Output& end, + const ov::Output& stride, + const ov::Output& axes) { return std::make_shared(in, begin, end, stride, axes); } -std::shared_ptr makeSlice(const ov::Output& in, - const ov::Output& begin, - const ov::Output& end, - const ov::Output& stride) { +std::shared_ptr makeSlice(const ov::Output& in, + const ov::Output& begin, + const ov::Output& end, + const ov::Output& stride) { return std::make_shared(in, begin, end, stride); } } // namespace builder 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 ae740603dc0..79ddd5ca00c 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 @@ -1,4 +1,4 @@ -// Copyright (C) 2022-2023 Intel Corporation +// Copyright (C) 2022-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // @@ -352,4 +352,4 @@ std::shared_ptr EdgeReplaceFunction::initOriginal() const { } } // namespace snippets } // namespace test -} // namespace ov \ No newline at end of file +} // namespace ov