Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Core] Remove unnecessary includes ops.hpp from src/core (#29928)

Tomasz Jankowski46f848c45216
diff --git a/src/core/shape_inference/include/avg_pool_shape_inference.hpp b/src/core/shape_inference/include/avg_pool_shape_inference.hpp
index e5ceb45b405..141e1b20bc8 100644
--- a/src/core/shape_inference/include/avg_pool_shape_inference.hpp
+++ b/src/core/shape_inference/include/avg_pool_shape_inference.hpp
@@ -6,6 +6,7 @@
#include "dimension_util.hpp"
#include "max_pool_shape_inference.hpp"
+#include "openvino/op/avg_pool.hpp"
#include "openvino/op/max_pool.hpp"
#include "utils.hpp"
diff --git a/src/core/shape_inference/include/batch_to_space_shape_inference.hpp b/src/core/shape_inference/include/batch_to_space_shape_inference.hpp
index 2aff41fe966..7e197f5b37a 100644
--- a/src/core/shape_inference/include/batch_to_space_shape_inference.hpp
+++ b/src/core/shape_inference/include/batch_to_space_shape_inference.hpp
@@ -8,7 +8,6 @@
#include "dimension_util.hpp"
#include "openvino/op/batch_to_space.hpp"
-#include "openvino/opsets/opset2.hpp"
#include "utils.hpp"
namespace ov {
diff --git a/src/core/shape_inference/include/broadcast_shape_inference.hpp b/src/core/shape_inference/include/broadcast_shape_inference.hpp
index ccef411a258..3a8ab52f30d 100644
--- a/src/core/shape_inference/include/broadcast_shape_inference.hpp
+++ b/src/core/shape_inference/include/broadcast_shape_inference.hpp
@@ -185,14 +185,14 @@ std::vector<TRShape> broadcast_base_shape_infer(const ov::op::util::BroadcastBas
auto target_as_shape = get_input_const_data_as_shape<TRShape>(op, 1, ta);
if (!target_as_shape) {
- if (auto concat = ov::as_type_ptr<ov::opset1::Concat>(op->get_input_node_shared_ptr(1))) {
+ if (auto concat = ov::as_type_ptr<ov::op::v0::Concat>(op->get_input_node_shared_ptr(1))) {
const auto concat_inputs = concat->input_values();
if (concat->get_output_partial_shape(0).is_static() && concat->get_shape().size() == 1 &&
concat_inputs.size() == shape_size(concat->get_shape())) {
target_as_shape.emplace();
for (const auto& concat_input : concat_inputs) {
auto source_node_ptr = concat_input.get_node_shared_ptr();
- if (auto source_const_ptr = ov::as_type_ptr<ov::opset1::Constant>(source_node_ptr)) {
+ if (auto source_const_ptr = ov::as_type_ptr<ov::op::v0::Constant>(source_node_ptr)) {
target_as_shape->push_back(source_const_ptr->get_axis_vector_val()[0]);
} else {
target_as_shape->push_back(Dimension::dynamic());
diff --git a/src/core/shape_inference/include/convolution_shape_inference.hpp b/src/core/shape_inference/include/convolution_shape_inference.hpp
index 79f70e06154..f58730c4bca 100644
--- a/src/core/shape_inference/include/convolution_shape_inference.hpp
+++ b/src/core/shape_inference/include/convolution_shape_inference.hpp
@@ -4,6 +4,7 @@
#pragma once
#include "convolution_shape_inference_util.hpp"
+#include "openvino/op/binary_convolution.hpp"
#include "openvino/op/convolution.hpp"
#include "utils.hpp"
diff --git a/src/core/shape_inference/include/convolution_shape_inference_util.hpp b/src/core/shape_inference/include/convolution_shape_inference_util.hpp
index 6dda678c0a7..69fe32dce49 100644
--- a/src/core/shape_inference/include/convolution_shape_inference_util.hpp
+++ b/src/core/shape_inference/include/convolution_shape_inference_util.hpp
@@ -7,6 +7,7 @@
#include "dimension_util.hpp"
#include "openvino/op/util/convolution_backprop_base.hpp"
#include "openvino/op/util/convolution_base.hpp"
+#include "openvino/op/util/deformable_convolution_base.hpp"
#include "pooling_shape_inference_util.hpp"
#include "utils.hpp"
diff --git a/src/core/shape_inference/include/deformable_convolution_shape_inference.hpp b/src/core/shape_inference/include/deformable_convolution_shape_inference.hpp
index c7524730108..698d308e570 100644
--- a/src/core/shape_inference/include/deformable_convolution_shape_inference.hpp
+++ b/src/core/shape_inference/include/deformable_convolution_shape_inference.hpp
@@ -6,6 +6,7 @@
#include <array>
#include "convolution_shape_inference_util.hpp"
+#include "openvino/op/deformable_convolution.hpp"
#include "openvino/op/util/deformable_convolution_base.hpp"
namespace ov {
diff --git a/src/core/shape_inference/include/depth_to_space_shape_inference.hpp b/src/core/shape_inference/include/depth_to_space_shape_inference.hpp
index c46097ca3df..6321f70d82e 100644
--- a/src/core/shape_inference/include/depth_to_space_shape_inference.hpp
+++ b/src/core/shape_inference/include/depth_to_space_shape_inference.hpp
@@ -7,7 +7,6 @@
#include <cstdint>
#include "openvino/op/depth_to_space.hpp"
-#include "openvino/opsets/opset1.hpp"
#include "utils.hpp"
namespace ov {
namespace op {
diff --git a/src/core/shape_inference/include/max_pool_shape_inference.hpp b/src/core/shape_inference/include/max_pool_shape_inference.hpp
index e9c94519927..105d5a7652f 100644
--- a/src/core/shape_inference/include/max_pool_shape_inference.hpp
+++ b/src/core/shape_inference/include/max_pool_shape_inference.hpp
@@ -5,6 +5,7 @@
#pragma once
#include "dimension_util.hpp"
+#include "openvino/op/max_pool.hpp"
#include "pooling_shape_inference_util.hpp"
#include "utils.hpp"
diff --git a/src/core/shape_inference/include/pooling_shape_inference_util.hpp b/src/core/shape_inference/include/pooling_shape_inference_util.hpp
index 690ce0548ab..317222c4e5a 100644
--- a/src/core/shape_inference/include/pooling_shape_inference_util.hpp
+++ b/src/core/shape_inference/include/pooling_shape_inference_util.hpp
@@ -5,6 +5,10 @@
#pragma once
#include "dimension_util.hpp"
+#include "openvino/op/adaptive_avg_pool.hpp"
+#include "openvino/op/adaptive_max_pool.hpp"
+#include "openvino/op/avg_pool.hpp"
+#include "openvino/op/max_pool.hpp"
#include "utils.hpp"
namespace ov {
diff --git a/src/core/shape_inference/include/prior_box_shape_inference_util.hpp b/src/core/shape_inference/include/prior_box_shape_inference_util.hpp
index fa61fcca58c..01ffefd5121 100644
--- a/src/core/shape_inference/include/prior_box_shape_inference_util.hpp
+++ b/src/core/shape_inference/include/prior_box_shape_inference_util.hpp
@@ -7,6 +7,8 @@
#include <array>
#include "dimension_util.hpp"
+#include "openvino/op/prior_box.hpp"
+#include "openvino/op/prior_box_clustered.hpp"
#include "utils.hpp"
namespace ov {
diff --git a/src/core/shape_inference/include/psroi_pooling_shape_inference.hpp b/src/core/shape_inference/include/psroi_pooling_shape_inference.hpp
index d703c724652..2845a731076 100644
--- a/src/core/shape_inference/include/psroi_pooling_shape_inference.hpp
+++ b/src/core/shape_inference/include/psroi_pooling_shape_inference.hpp
@@ -8,6 +8,7 @@
#include "compare.hpp"
#include "dimension_util.hpp"
+#include "openvino/op/psroi_pooling.hpp"
#include "openvino/op/roi_pooling.hpp"
#include "roi_pooling_shape_inference.hpp"
diff --git a/src/core/shape_inference/include/shape_nodes.hpp b/src/core/shape_inference/include/shape_nodes.hpp
index dce91820bd9..3d43ee0794d 100644
--- a/src/core/shape_inference/include/shape_nodes.hpp
+++ b/src/core/shape_inference/include/shape_nodes.hpp
@@ -4,8 +4,6 @@
#pragma once
#include "openvino/op/util/arithmetic_reductions_keep_dims.hpp"
#include "openvino/op/util/logical_reduction_keep_dims.hpp"
-#include "openvino/opsets/opset1.hpp"
-#include "openvino/opsets/opset3.hpp"
#include "utils.hpp"
namespace ov {
diff --git a/src/core/shape_inference/include/space_to_depth_shape_inference.hpp b/src/core/shape_inference/include/space_to_depth_shape_inference.hpp
index 8cc0d6ba19f..8567e2f4904 100644
--- a/src/core/shape_inference/include/space_to_depth_shape_inference.hpp
+++ b/src/core/shape_inference/include/space_to_depth_shape_inference.hpp
@@ -7,7 +7,6 @@
#include <cstdint>
#include "openvino/op/space_to_depth.hpp"
-#include "openvino/opsets/opset1.hpp"
#include "utils.hpp"
namespace ov {
namespace op {
diff --git a/src/core/shape_inference/include/utils.hpp b/src/core/shape_inference/include/utils.hpp
index 2b229cdb2b9..8bbdd052510 100644
--- a/src/core/shape_inference/include/utils.hpp
+++ b/src/core/shape_inference/include/utils.hpp
@@ -10,7 +10,6 @@
#include "element_visitor.hpp"
#include "openvino/core/bound_evaluation_util.hpp"
#include "openvino/core/validation_util.hpp"
-#include "openvino/opsets/opset1.hpp"
#include "shape_infer_type_utils.hpp"
#include "tensor_data_accessor.hpp"
@@ -211,7 +210,7 @@ std::optional<TRes> get_input_const_data_as(const ov::Node* op,
if (auto t = tensor_accessor(idx)) {
return {get_tensor_data_as<TData, TRes>(t, std::forward<UnaryOperation>(func))};
} else {
- const auto& constant = ov::as_type_ptr<ov::opset1::Constant>(op->get_input_node_shared_ptr(idx));
+ const auto& constant = ov::as_type_ptr<ov::op::v0::Constant>(op->get_input_node_shared_ptr(idx));
NODE_VALIDATION_CHECK(op, constant != nullptr, "Static shape inference lacks constant data on port ", idx);
const auto& et = constant->get_element_type();
const auto& shape = constant->get_shape();
@@ -312,7 +311,7 @@ std::optional<TShape> get_input_const_data_as_shape(const ov::Node* op,
shape.emplace(get_tensor_data_as<TDimValue>(t, std::forward<UnaryOperation>(func)));
} else if (port < op->get_input_size()) {
PartialShape s;
- if (auto c = ov::as_type_ptr<ov::opset1::Constant>(op->get_input_node_shared_ptr(port))) {
+ if (auto c = ov::as_type_ptr<ov::op::v0::Constant>(op->get_input_node_shared_ptr(port))) {
shape.emplace(get_raw_data_as<TDimValue>(c->get_element_type(),
c->get_data_ptr(),
shape_size(c->get_shape()),
diff --git a/src/core/src/bound_evaluate.cpp b/src/core/src/bound_evaluate.cpp
index fddc596287e..78a4b0a89a6 100644
--- a/src/core/src/bound_evaluate.cpp
+++ b/src/core/src/bound_evaluate.cpp
@@ -10,8 +10,17 @@
#include "openvino/core/shape_util.hpp"
#include "openvino/core/tensor_util.hpp"
#include "openvino/core/validation_util.hpp"
+#include "openvino/op/concat.hpp"
+#include "openvino/op/equal.hpp"
+#include "openvino/op/logical_or.hpp"
+#include "openvino/op/reduce_logical_or.hpp"
+#include "openvino/op/reduce_max.hpp"
+#include "openvino/op/reduce_min.hpp"
+#include "openvino/op/select.hpp"
+#include "openvino/op/shape_of.hpp"
+#include "openvino/op/unsqueeze.hpp"
+#include "openvino/op/util/op_types.hpp"
#include "openvino/op/util/symbolic_info.hpp"
-#include "openvino/opsets/opset10.hpp"
#include "transformations/rt_info/decompression.hpp"
#include "transformations/rt_info/is_shape_subgraph.hpp"
diff --git a/src/core/src/op/util/topk_base.cpp b/src/core/src/op/util/topk_base.cpp
index 5d31cad004b..80a1f7d305e 100644
--- a/src/core/src/op/util/topk_base.cpp
+++ b/src/core/src/op/util/topk_base.cpp
@@ -8,6 +8,7 @@
#include "itt.hpp"
#include "openvino/core/validation_util.hpp"
+#include "openvino/op/util/op_types.hpp"
#include "openvino/op/util/precision_sensitive_attribute.hpp"
#include "topk_shape_inference.hpp"
diff --git a/src/core/src/pass/low_latency.cpp b/src/core/src/pass/low_latency.cpp
index ef4551d20ee..b2e9f95c0e4 100644
--- a/src/core/src/pass/low_latency.cpp
+++ b/src/core/src/pass/low_latency.cpp
@@ -8,13 +8,39 @@
#include "openvino/cc/pass/itt.hpp"
#include "openvino/core/rt_info.hpp"
+#include "openvino/op/broadcast.hpp"
+#include "openvino/op/gru_cell.hpp"
+#include "openvino/op/gru_sequence.hpp"
+#include "openvino/op/lstm_cell.hpp"
+#include "openvino/op/lstm_sequence.hpp"
+#include "openvino/op/rnn_cell.hpp"
+#include "openvino/op/rnn_sequence.hpp"
+#include "openvino/op/shape_of.hpp"
+#include "openvino/op/squeeze.hpp"
+#include "openvino/op/tensor_iterator.hpp"
+#include "openvino/op/unsqueeze.hpp"
+#include "openvino/op/util/sub_graph_base.hpp"
#include "openvino/op/util/variable.hpp"
-#include "openvino/opsets/opset1.hpp"
-#include "openvino/opsets/opset9.hpp"
#include "openvino/pass/graph_rewrite.hpp"
#include "openvino/util/log.hpp"
#include "transformations/utils/utils.hpp"
+using ov::op::v0::Constant;
+using ov::op::v0::Result;
+using ov::op::v0::RNNCell;
+using ov::op::v0::Squeeze;
+using ov::op::v0::TensorIterator;
+using ov::op::v0::Unsqueeze;
+using ov::op::v3::Broadcast;
+using ov::op::v3::GRUCell;
+using ov::op::v3::ShapeOf;
+using ov::op::v4::LSTMCell;
+using ov::op::v5::GRUSequence;
+using ov::op::v5::LSTMSequence;
+using ov::op::v5::RNNSequence;
+using ov::op::v6::Assign;
+using ov::op::v6::ReadValue;
+
namespace {
std::string generate_variable_name(const std::string& op_name, const std::string& param_name, int64_t variable_idx) {
return op_name + "/" + param_name + "/" + "variable_" + std::to_string(variable_idx);
@@ -35,8 +61,6 @@ const std::string msg_low_latency_already_applied = "LowLatency2 transformation
void unroll_single_iteration(const std::shared_ptr<ov::op::util::SubGraphOp>& sub_graph_op,
const std::shared_ptr<ov::Model>& outer_f) {
- using namespace ov::opset9;
-
const auto& params = sub_graph_op->get_function()->get_parameters();
const auto& results = sub_graph_op->get_function()->get_results();
// before: Layer1 -> TI [input -> bodyParameter -> Layer2 -> ...]
@@ -78,20 +102,17 @@ void unroll_single_iteration(const std::shared_ptr<ov::op::util::SubGraphOp>& su
}
ov::Output<ov::Node> create_init_subgraph(const ov::Output<ov::Node>& in_node, ov::pass::NodeRegistry& to) {
- using namespace ov::opset9;
-
auto const_zero = to.make<Constant>(in_node.get_element_type(), ov::Shape{1}, 0);
auto shape_of = to.make<ShapeOf>(in_node);
auto broadcast = to.make<Broadcast>(const_zero, shape_of);
return broadcast->output(0);
}
-std::shared_ptr<ov::opset9::Assign> replace_with_memory(const ov::Input<ov::Node>& input,
+std::shared_ptr<ov::op::v6::Assign> replace_with_memory(const ov::Input<ov::Node>& input,
const ov::Output<ov::Node>& output,
const std::string& variable_name,
bool use_const_initializer,
ov::pass::NodeRegistry& to) {
- using namespace ov::opset9;
using namespace ov::op::util;
ov::Output<ov::Node> read_value_in = input.get_source_output();
@@ -109,11 +130,11 @@ std::shared_ptr<ov::opset9::Assign> replace_with_memory(const ov::Input<ov::Node
return assign;
}
-std::vector<std::shared_ptr<ov::opset9::Assign>> replace_with_memory(const std::shared_ptr<ov::Node>& node,
+std::vector<std::shared_ptr<ov::op::v6::Assign>> replace_with_memory(const std::shared_ptr<ov::Node>& node,
const std::vector<size_t>& indexes,
bool use_const_initializer,
ov::pass::NodeRegistry& to) {
- std::vector<std::shared_ptr<ov::opset9::Assign>> new_assigns;
+ std::vector<std::shared_ptr<ov::op::v6::Assign>> new_assigns;
size_t var_idx = 0;
for (const auto& idx : indexes) {
auto in = node->input(idx);
@@ -136,7 +157,6 @@ bool need_unroll(const std::shared_ptr<ov::Node>& op) {
}
ov::OutputVector prepare_inputs(const std::shared_ptr<ov::Node>& op, size_t seq_len_idx, ov::pass::NodeRegistry& to) {
- using namespace ov::opset9;
ov::OutputVector inputs;
auto axis_0 = to.make<Constant>(ov::element::i32, ov::Shape{1}, 0);
auto axis_1 = to.make<Constant>(ov::element::i32, ov::Shape{1}, 1);
@@ -151,12 +171,11 @@ ov::OutputVector prepare_inputs(const std::shared_ptr<ov::Node>& op, size_t seq_
return inputs;
}
-std::vector<std::shared_ptr<ov::opset9::Assign>> process_sequence(const std::shared_ptr<ov::Node>& op,
+std::vector<std::shared_ptr<ov::op::v6::Assign>> process_sequence(const std::shared_ptr<ov::Node>& op,
bool m_use_const_initializer,
ov::pass::NodeRegistry& to) {
- using namespace ov::opset9;
std::shared_ptr<ov::Node> cell;
- std::vector<std::shared_ptr<ov::opset9::Assign>> new_assigns;
+ std::vector<std::shared_ptr<ov::op::v6::Assign>> new_assigns;
bool unroll = false;
if (auto lstm_seq_v5 = ov::as_type_ptr<LSTMSequence>(op)) {
unroll = need_unroll(op);
@@ -237,7 +256,6 @@ std::vector<std::shared_ptr<ov::opset9::Assign>> process_sequence(const std::sha
bool ov::pass::LowLatency2::run_on_model(const std::shared_ptr<Model>& f) {
RUN_ON_MODEL_SCOPE(LowLatency2);
- using namespace ov::opset9;
using namespace ov::op::util;
NodeRegistry to;
diff --git a/src/core/src/pass/make_stateful.cpp b/src/core/src/pass/make_stateful.cpp
index 03ce1f80438..079265f011b 100644
--- a/src/core/src/pass/make_stateful.cpp
+++ b/src/core/src/pass/make_stateful.cpp
@@ -7,9 +7,9 @@
#include <memory>
#include "openvino/cc/pass/itt.hpp"
+#include "openvino/core/graph_util.hpp"
#include "openvino/core/rt_info.hpp"
#include "openvino/op/util/variable.hpp"
-#include "openvino/opsets/opset8.hpp"
namespace {
diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp
index 4986defccbb..34f99b572d1 100644
--- a/src/core/src/pass/serialize.cpp
+++ b/src/core/src/pass/serialize.cpp
@@ -19,9 +19,18 @@
#include "openvino/core/model.hpp"
#include "openvino/core/parallel.hpp"
#include "openvino/core/type/float16.hpp"
+#include "openvino/op/binary_convolution.hpp"
#include "openvino/op/constant.hpp"
+#include "openvino/op/convolution.hpp"
+#include "openvino/op/group_conv.hpp"
+#include "openvino/op/loop.hpp"
+#include "openvino/op/lstm_cell.hpp"
+#include "openvino/op/util/avg_pool_base.hpp"
+#include "openvino/op/util/deformable_convolution_base.hpp"
#include "openvino/op/util/framework_node.hpp"
-#include "openvino/opsets/opset1.hpp"
+#include "openvino/op/util/max_pool_base.hpp"
+#include "openvino/op/util/op_types.hpp"
+#include "openvino/op/util/sub_graph_base.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "openvino/reference/convert.hpp"
#include "openvino/runtime/aligned_buffer.hpp"
@@ -851,7 +860,7 @@ private:
void clone_op_and_fix_paddings(const T* op) {
for (const auto& input : op->inputs()) {
m_parameters.emplace_back(
- std::make_shared<ov::opset1::Parameter>(input.get_element_type(), input.get_partial_shape()));
+ std::make_shared<ov::op::v0::Parameter>(input.get_element_type(), input.get_partial_shape()));
}
m_cloned_node = op->clone_with_new_inputs(m_parameters);
auto typed_cloned_node = ov::as_type_ptr<T>(m_cloned_node);
@@ -867,29 +876,29 @@ public:
}
explicit PaddingsFixer(ov::Node* node) : m_node(node) {
- if (auto op = ov::as_type<ov::opset1::Convolution>(node)) {
+ if (auto op = ov::as_type<ov::op::v1::Convolution>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
- clone_op_and_fix_paddings<ov::opset1::Convolution, ov::CoordinateDiff>(op);
+ clone_op_and_fix_paddings<ov::op::v1::Convolution, ov::CoordinateDiff>(op);
}
- } else if (auto op = ov::as_type<ov::opset1::GroupConvolution>(node)) {
+ } else if (auto op = ov::as_type<ov::op::v1::GroupConvolution>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
- clone_op_and_fix_paddings<ov::opset1::GroupConvolution, ov::CoordinateDiff>(op);
+ clone_op_and_fix_paddings<ov::op::v1::GroupConvolution, ov::CoordinateDiff>(op);
}
- } else if (auto op = ov::as_type<ov::opset1::ConvolutionBackpropData>(node)) {
+ } else if (auto op = ov::as_type<ov::op::v1::ConvolutionBackpropData>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
- clone_op_and_fix_paddings<ov::opset1::ConvolutionBackpropData, ov::CoordinateDiff>(op);
+ clone_op_and_fix_paddings<ov::op::v1::ConvolutionBackpropData, ov::CoordinateDiff>(op);
}
- } else if (auto op = ov::as_type<ov::opset1::GroupConvolutionBackpropData>(node)) {
+ } else if (auto op = ov::as_type<ov::op::v1::GroupConvolutionBackpropData>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
- clone_op_and_fix_paddings<ov::opset1::GroupConvolutionBackpropData, ov::CoordinateDiff>(op);
+ clone_op_and_fix_paddings<ov::op::v1::GroupConvolutionBackpropData, ov::CoordinateDiff>(op);
}
} else if (auto op = ov::as_type<ov::op::util::DeformableConvolutionBase>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
clone_op_and_fix_paddings<ov::op::util::DeformableConvolutionBase, ov::CoordinateDiff>(op);
}
- } else if (auto op = ov::as_type<ov::opset1::BinaryConvolution>(node)) {
+ } else if (auto op = ov::as_type<ov::op::v1::BinaryConvolution>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
- clone_op_and_fix_paddings<ov::opset1::BinaryConvolution, ov::CoordinateDiff>(op);
+ clone_op_and_fix_paddings<ov::op::v1::BinaryConvolution, ov::CoordinateDiff>(op);
}
} else if (auto op = ov::as_type<ov::op::util::AvgPoolBase>(node)) {
if (pad_agnostic_types.count(op->get_auto_pad())) {
@@ -1095,7 +1104,7 @@ void ngfunction_2_ir(pugi::xml_node& netXml,
pugi::xml_node input = layer.append_child("input");
for (auto& i : node->inputs()) {
// WA for LSTMCellv0, peephole input shall not be serialized
- if (i.get_index() == 6 && ov::as_type<ov::opset1::LSTMCell>(node)) {
+ if (i.get_index() == 6 && ov::as_type<ov::op::v0::LSTMCell>(node)) {
port_id++;
continue;
}
diff --git a/src/core/src/preprocess/pre_post_process.cpp b/src/core/src/preprocess/pre_post_process.cpp
index bbe302e6fe1..ea4dcff859f 100644
--- a/src/core/src/preprocess/pre_post_process.cpp
+++ b/src/core/src/preprocess/pre_post_process.cpp
@@ -9,6 +9,7 @@
#include "itt.hpp"
#include "layout_utils.hpp"
#include "openvino/core/model.hpp"
+#include "openvino/op/util/multi_subgraph_base.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "openvino/pass/manager.hpp"
#include "openvino/pass/pattern/op/true.hpp"
@@ -270,7 +271,7 @@ std::shared_ptr<Model> PrePostProcessor::build() {
FunctionGuard guard(function);
bool need_validate = false;
auto results = function->get_results();
- auto parameters_list = std::list<std::shared_ptr<opset8::Parameter>>(function->get_parameters().begin(),
+ auto parameters_list = std::list<std::shared_ptr<op::v0::Parameter>>(function->get_parameters().begin(),
function->get_parameters().end());
for (const auto& input_info : m_impl->m_inputs) {
diff --git a/src/core/src/preprocess/preprocess_impls.cpp b/src/core/src/preprocess/preprocess_impls.cpp
index a86bfcab701..3e61a0bf7b6 100644
--- a/src/core/src/preprocess/preprocess_impls.cpp
+++ b/src/core/src/preprocess/preprocess_impls.cpp
@@ -101,7 +101,7 @@ InputInfo::InputInfoImpl::InputInfoData InputInfo::InputInfoImpl::create_new_par
// Create separate parameter for each plane. Shape is based on color format
for (size_t plane = 0; plane < color_info->planes_count(); plane++) {
auto plane_shape = color_info->shape(plane, new_param_shape, res.m_tensor_layout);
- auto plane_param = std::make_shared<opset8::Parameter>(tensor_elem_type, plane_shape);
+ auto plane_param = std::make_shared<op::v0::Parameter>(tensor_elem_type, plane_shape);
if (plane < get_tensor_data()->planes_sub_names().size()) {
std::unordered_set<std::string> plane_tensor_names;
std::string sub_name;
@@ -157,7 +157,7 @@ PreStepsList InputInfo::InputInfoImpl::create_implicit_steps(const Preprocessing
bool InputInfo::InputInfoImpl::build(const std::shared_ptr<Model>& model,
std::tuple<std::unordered_set<std::string>, bool>& existing_names,
- std::list<std::shared_ptr<opset8::Parameter>>& parameters_list) {
+ std::list<std::shared_ptr<op::v0::Parameter>>& parameters_list) {
auto data = create_new_params(existing_names, model);
auto consumers = data.m_param->output(0).get_target_inputs();
bool need_validate = false;
@@ -211,7 +211,7 @@ bool InputInfo::InputInfoImpl::build(const std::shared_ptr<Model>& model,
// Replace parameter
for (auto consumer : consumers) {
- if (ov::as_type<ov::opset8::Result>(consumer.get_node())) {
+ if (ov::as_type<ov::op::v0::Result>(consumer.get_node())) {
// Some result points to old parameter (Param->Result case), need to trigger revalidation
need_validate = true;
}
@@ -327,7 +327,7 @@ void InputInfo::InputInfoImpl::dump(std::ostream& str,
//----------- OutputInfoImpl ----------
void OutputInfo::OutputInfoImpl::build(ov::ResultVector& results) {
auto node = m_output_node;
- const auto result = ov::as_type_ptr<opset8::Result>(node.get_node_shared_ptr());
+ const auto result = ov::as_type_ptr<op::v0::Result>(node.get_node_shared_ptr());
// Set result layout from 'model' information
if (get_model_data()->is_layout_set()) {
@@ -412,10 +412,10 @@ void OutputInfo::OutputInfoImpl::build(ov::ResultVector& results) {
}
void OutputInfo::OutputInfoImpl::dump(std::ostream& str) const {
- std::shared_ptr<opset8::Result> result;
+ std::shared_ptr<op::v0::Result> result;
auto node = m_output_node;
const auto& start_out_node_names = node.get_tensor().get_names();
- result = ov::as_type_ptr<opset8::Result>(node.get_node_shared_ptr());
+ result = ov::as_type_ptr<op::v0::Result>(node.get_node_shared_ptr());
auto model_layout = get_model_data()->is_layout_set() ? get_model_data()->get_layout() : result->get_layout();
PostprocessingContext context(model_layout);
if (get_tensor_data()->is_layout_set()) {
diff --git a/src/core/src/preprocess/preprocess_impls.hpp b/src/core/src/preprocess/preprocess_impls.hpp
index 342c6846709..dff0f608e2a 100644
--- a/src/core/src/preprocess/preprocess_impls.hpp
+++ b/src/core/src/preprocess/preprocess_impls.hpp
@@ -4,11 +4,10 @@
#pragma once
-#include <openvino/core/preprocess/input_info.hpp>
-#include <openvino/core/preprocess/output_info.hpp>
-#include <openvino/opsets/opset8.hpp>
-
#include "color_utils.hpp"
+#include "openvino/core/preprocess/input_info.hpp"
+#include "openvino/core/preprocess/output_info.hpp"
+#include "openvino/op/parameter.hpp"
#include "preprocess_steps_impl.hpp"
namespace ov {
@@ -261,8 +260,8 @@ private:
/// \brief InputInfoImpl - internal data structure
struct InputInfo::InputInfoImpl {
struct InputInfoData {
- std::vector<std::shared_ptr<opset8::Parameter>> m_new_params;
- std::shared_ptr<opset8::Parameter> m_param;
+ std::vector<std::shared_ptr<op::v0::Parameter>> m_new_params;
+ std::shared_ptr<op::v0::Parameter> m_param;
Layout m_model_layout;
Layout m_tensor_layout;
std::vector<Output<Node>> as_nodes() const {
@@ -270,7 +269,7 @@ struct InputInfo::InputInfoImpl {
std::transform(m_new_params.begin(),
m_new_params.end(),
std::back_inserter(res),
- [](const std::shared_ptr<opset8::Parameter>& param) {
+ [](const std::shared_ptr<op::v0::Parameter>& param) {
return param;
});
return res;
@@ -305,7 +304,7 @@ struct InputInfo::InputInfoImpl {
bool build(const std::shared_ptr<Model>& model,
std::tuple<std::unordered_set<std::string>, bool>& existing_names,
- std::list<std::shared_ptr<opset8::Parameter>>& parameters_list);
+ std::list<std::shared_ptr<op::v0::Parameter>>& parameters_list);
void dump(std::ostream& str,
const std::shared_ptr<Model>& model,
diff --git a/src/core/src/preprocess/preprocess_steps_impl.cpp b/src/core/src/preprocess/preprocess_steps_impl.cpp
index 9bcae12c04e..628620fa732 100644
--- a/src/core/src/preprocess/preprocess_steps_impl.cpp
+++ b/src/core/src/preprocess/preprocess_steps_impl.cpp
@@ -8,9 +8,28 @@
#include "layout_utils.hpp"
#include "openvino/core/node.hpp"
#include "openvino/core/shape.hpp"
+#include "openvino/op/add.hpp"
+#include "openvino/op/clamp.hpp"
+#include "openvino/op/constant.hpp"
+#include "openvino/op/convert.hpp"
+#include "openvino/op/convolution.hpp"
+#include "openvino/op/divide.hpp"
+#include "openvino/op/gather.hpp"
+#include "openvino/op/i420_to_bgr.hpp"
+#include "openvino/op/i420_to_rgb.hpp"
+#include "openvino/op/interpolate.hpp"
+#include "openvino/op/multiply.hpp"
#include "openvino/op/nv12_to_bgr.hpp"
#include "openvino/op/nv12_to_rgb.hpp"
-#include "openvino/opsets/opset8.hpp"
+#include "openvino/op/pad.hpp"
+#include "openvino/op/range.hpp"
+#include "openvino/op/round.hpp"
+#include "openvino/op/shape_of.hpp"
+#include "openvino/op/slice.hpp"
+#include "openvino/op/subtract.hpp"
+#include "openvino/op/transpose.hpp"
+#include "openvino/op/unsqueeze.hpp"
+#include "openvino/op/util/interpolate_base.hpp"
#include "openvino/util/common_util.hpp"
#include "transformations/rt_info/preprocessing_attribute.hpp"
@@ -53,17 +72,19 @@ static std::string vector_to_string(const std::vector<T>& values) {
}
namespace {
std::shared_ptr<ov::Node> grey_from_yuv_single_plane(const std::vector<Output<Node>>& nodes) {
- using namespace ov::opset8;
- const auto axis = Constant::create(element::i32, {1}, {1});
- const auto yuv_shape_of = std::make_shared<ShapeOf>(nodes[0]);
- const auto get_height = std::make_shared<Gather>(yuv_shape_of, axis, Constant::create(element::i32, {}, {0}));
+ const auto axis = op::v0::Constant::create(element::i32, {1}, {1});
+ const auto yuv_shape_of = std::make_shared<op::v3::ShapeOf>(nodes[0]);
+ const auto get_height =
+ std::make_shared<op::v8::Gather>(yuv_shape_of, axis, op::v0::Constant::create(element::i32, {}, {0}));
- const auto start = Constant::create(element::i32, {1}, {0});
+ const auto start = op::v0::Constant::create(element::i32, {1}, {0});
// slice stop is input height * (2/3)
auto mul_height =
- std::make_shared<Multiply>(get_height, Constant::create(get_height->get_element_type(), {1}, {2}));
- auto stop = std::make_shared<Divide>(mul_height, Constant::create(get_height->get_element_type(), {1}, {3}));
- const auto step = Constant::create(element::i32, {1}, {1});
+ std::make_shared<op::v1::Multiply>(get_height,
+ op::v0::Constant::create(get_height->get_element_type(), {1}, {2}));
+ auto stop = std::make_shared<op::v1::Divide>(mul_height,
+ op::v0::Constant::create(get_height->get_element_type(), {1}, {3}));
+ const auto step = op::v0::Constant::create(element::i32, {1}, {1});
//
return std::make_shared<ov::op::v8::Slice>(nodes[0], start, stop, step, axis);
}
@@ -185,13 +206,13 @@ void PreStepsList::add_pad_impl(const std::vector<int>& pads_begin,
"'convert_element_type' before padding. Current type is: ",
element_type);
- auto pad_value = opset8::Constant::create(node.get_element_type(), Shape{}, pad_values);
+ auto pad_value = op::v0::Constant::create(node.get_element_type(), Shape{}, pad_values);
- auto npads_begin = opset8::Constant::create(element::i64, Shape{pads_begin.size()}, pads_begin);
- auto npads_end = opset8::Constant::create(element::i64, Shape{pads_end.size()}, pads_end);
- auto npad_value = opset8::Constant::create(element_type, Shape{}, pad_values);
+ auto npads_begin = op::v0::Constant::create(element::i64, Shape{pads_begin.size()}, pads_begin);
+ auto npads_end = op::v0::Constant::create(element::i64, Shape{pads_end.size()}, pads_end);
+ auto npad_value = op::v0::Constant::create(element_type, Shape{}, pad_values);
- auto pad = std::make_shared<opset8::Pad>(node, npads_begin, npads_end, npad_value, mode);
+ auto pad = std::make_shared<op::v1::Pad>(node, npads_begin, npads_end, npad_value, mode);
return std::make_tuple(std::vector<Output<Node>>{pad}, true);
},
name);
@@ -309,10 +330,10 @@ void PreStepsList::add_crop_impl(const std::vector<int>& begin, const std::vecto
"Can't crop multi-plane input. Suggesting to convert current image to "
"RGB/BGR color format using 'PreProcessSteps::convert_color'");
auto node = nodes.front();
- auto start = opset8::Constant::create(element::i32, {begin.size()}, begin);
- auto stop = opset8::Constant::create(element::i32, {end.size()}, end);
- auto step = opset8::Constant::create(element::i32, {begin.size()}, std::vector<int32_t>(begin.size(), 1));
- auto slice = std::make_shared<opset8::Slice>(node, start, stop, step);
+ auto start = op::v0::Constant::create(element::i32, {begin.size()}, begin);
+ auto stop = op::v0::Constant::create(element::i32, {end.size()}, end);
+ auto step = op::v0::Constant::create(element::i32, {begin.size()}, std::vector<int32_t>(begin.size(), 1));
+ auto slice = std::make_shared<op::v8::Slice>(node, start, stop, step);
return std::make_tuple(std::vector<Output<Node>>{slice}, true);
},
name_str.str());
@@ -355,7 +376,7 @@ void PreStepsList::add_convert_layout_impl(const Layout& layout) {
}
auto axes = op::v0::Constant::create<int64_t>(element::i64, const_shape, vals);
// Add unsqueeze on top
- node = std::make_shared<opset8::Unsqueeze>(node, axes);
+ node = std::make_shared<op::v0::Unsqueeze>(node, axes);
}
auto permutation = layout::utils::find_permutation(unsqueeze_layout, shape, dst_layout);
if (permutation.empty()) {
@@ -698,10 +719,10 @@ std::tuple<std::vector<Output<Node>>, bool> PreStepsList::cut_last_channel(const
" doesn't have `channels` dimension");
auto channels_idx = ov::layout::channels_idx(context.layout());
- auto start = opset8::Constant::create(element::i32, {1}, {0});
- auto stop = opset8::Constant::create(element::i32, {1}, {-1}); // Everything except last channel
- auto step = opset8::Constant::create(element::i32, {1}, {1});
- auto axis = opset8::Constant::create(element::i32, {1}, {channels_idx}); // E.g. 3
+ auto start = op::v0::Constant::create(element::i32, {1}, {0});
+ auto stop = op::v0::Constant::create(element::i32, {1}, {-1}); // Everything except last channel
+ auto step = op::v0::Constant::create(element::i32, {1}, {1});
+ auto axis = op::v0::Constant::create(element::i32, {1}, {channels_idx}); // E.g. 3
auto slice = std::make_shared<ov::op::v8::Slice>(nodes[0], start, stop, step, axis);
return std::make_tuple(std::vector<Output<Node>>{slice}, false);
}
diff --git a/src/core/src/validation_util.cpp b/src/core/src/validation_util.cpp
index f58c0d71b3a..7bb55931c62 100644
--- a/src/core/src/validation_util.cpp
+++ b/src/core/src/validation_util.cpp
@@ -12,9 +12,12 @@
#include "openvino/core/constant_fold_utils.hpp"
#include "openvino/core/dimension.hpp"
#include "openvino/op/concat.hpp"
+#include "openvino/op/convert.hpp"
#include "openvino/op/gather.hpp"
#include "openvino/op/negative.hpp"
-#include "openvino/op/ops.hpp"
+#include "openvino/op/util/framework_node.hpp"
+#include "openvino/op/util/op_types.hpp"
+#include "openvino/op/util/shape_of_base.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "openvino/util/common_util.hpp"
#include "sequence_generator.hpp"
diff --git a/src/core/tests/type_prop/eye.cpp b/src/core/tests/type_prop/eye.cpp
index 9c2fb89dd89..9eabd9a94b4 100644
--- a/src/core/tests/type_prop/eye.cpp
+++ b/src/core/tests/type_prop/eye.cpp
@@ -7,6 +7,7 @@
#include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/type_prop.hpp"
#include "eye_shape_inference.hpp"
+#include "openvino/op/squeeze.hpp"
using namespace std;
using namespace ov;
diff --git a/src/core/tests/type_prop/group_convolution_backprop_data.cpp b/src/core/tests/type_prop/group_convolution_backprop_data.cpp
index b9f60d81424..af81cf56944 100644
--- a/src/core/tests/type_prop/group_convolution_backprop_data.cpp
+++ b/src/core/tests/type_prop/group_convolution_backprop_data.cpp
@@ -6,6 +6,7 @@
#include "common_test_utils/type_prop.hpp"
#include "convolution_shape_inference.hpp"
+#include "openvino/op/group_conv.hpp"
using namespace std;
using namespace ov;
diff --git a/src/core/tests/type_prop/strided_slice.cpp b/src/core/tests/type_prop/strided_slice.cpp
index 3971bce9154..9ddf7073103 100644
--- a/src/core/tests/type_prop/strided_slice.cpp
+++ b/src/core/tests/type_prop/strided_slice.cpp
@@ -7,8 +7,10 @@
#include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/type_prop.hpp"
#include "openvino/core/except.hpp"
+#include "openvino/op/broadcast.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/shape_of.hpp"
+#include "openvino/op/subtract.hpp"
#include "strided_slice_shape_inference.hpp"
using namespace std;
diff --git a/src/core/tests/type_prop/top_k.cpp b/src/core/tests/type_prop/top_k.cpp
index e18c0741741..cb66d31ef56 100644
--- a/src/core/tests/type_prop/top_k.cpp
+++ b/src/core/tests/type_prop/top_k.cpp
@@ -4,6 +4,10 @@
#include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/type_prop.hpp"
+#include "openvino/op/broadcast.hpp"
+#include "openvino/op/concat.hpp"
+#include "openvino/op/reduce_min.hpp"
+#include "openvino/op/squeeze.hpp"
#include "topk_shape_inference.hpp"
using namespace ov;
diff --git a/src/inference/src/check_network_batchable.cpp b/src/inference/src/check_network_batchable.cpp
index e1f7128c120..4668d8d3e9d 100644
--- a/src/inference/src/check_network_batchable.cpp
+++ b/src/inference/src/check_network_batchable.cpp
@@ -1,8 +1,8 @@
#include "check_network_batchable.hpp"
#include "openvino/core/dimension.hpp"
+#include "openvino/op/convert.hpp"
#include "openvino/op/detection_output.hpp"
-#include "openvino/op/ops.hpp"
#include "openvino/pass/manager.hpp"
#include "transformations/common_optimizations/dimension_tracking.hpp"
#include "transformations/init_node_info.hpp"
diff --git a/src/plugins/intel_cpu/src/shape_inference/custom/gather.cpp b/src/plugins/intel_cpu/src/shape_inference/custom/gather.cpp
index 46d1fdb2907..de6619e4a8b 100644
--- a/src/plugins/intel_cpu/src/shape_inference/custom/gather.cpp
+++ b/src/plugins/intel_cpu/src/shape_inference/custom/gather.cpp
@@ -4,6 +4,7 @@
#include "gather.hpp"
+#include "openvino/op/gather.hpp"
#include "utils.hpp"
namespace ov::intel_cpu::node {
diff --git a/src/plugins/intel_cpu/src/shape_inference/custom/reshape.cpp b/src/plugins/intel_cpu/src/shape_inference/custom/reshape.cpp
index cd50029a2cb..879a2f2b588 100644
--- a/src/plugins/intel_cpu/src/shape_inference/custom/reshape.cpp
+++ b/src/plugins/intel_cpu/src/shape_inference/custom/reshape.cpp
@@ -6,6 +6,9 @@
#include <vector>
+#include "openvino/op/reshape.hpp"
+#include "openvino/op/squeeze.hpp"
+#include "openvino/op/unsqueeze.hpp"
#include "utils.hpp"
#include "utils/general_utils.h"
diff --git a/src/plugins/intel_cpu/src/shape_inference/custom/strided_slice.cpp b/src/plugins/intel_cpu/src/shape_inference/custom/strided_slice.cpp
index c2237f2f3d9..e4f95812627 100644
--- a/src/plugins/intel_cpu/src/shape_inference/custom/strided_slice.cpp
+++ b/src/plugins/intel_cpu/src/shape_inference/custom/strided_slice.cpp
@@ -5,6 +5,8 @@
#include "strided_slice.hpp"
#include "openvino/core/type.hpp"
+#include "openvino/op/slice_scatter.hpp"
+#include "openvino/op/strided_slice.hpp"
#include "shape_inference/shape_inference.hpp"
#include "slice_shape_inference.hpp"
#include "utils.hpp"
diff --git a/src/plugins/intel_cpu/src/shape_inference/custom/transpose.cpp b/src/plugins/intel_cpu/src/shape_inference/custom/transpose.cpp
index 222df179beb..8e0c3d16578 100644
--- a/src/plugins/intel_cpu/src/shape_inference/custom/transpose.cpp
+++ b/src/plugins/intel_cpu/src/shape_inference/custom/transpose.cpp
@@ -4,6 +4,7 @@
#include "transpose.hpp"
+#include "openvino/op/transpose.hpp"
#include "utils.hpp"
namespace ov::intel_cpu::node {
diff --git a/src/plugins/intel_gpu/src/graph/dft.cpp b/src/plugins/intel_gpu/src/graph/dft.cpp
index f044ce53f4e..6653352ab0a 100644
--- a/src/plugins/intel_gpu/src/graph/dft.cpp
+++ b/src/plugins/intel_gpu/src/graph/dft.cpp
@@ -9,6 +9,8 @@
#include "irdft_shape_inference.hpp"
#include "json_object.h"
+#include "openvino/op/dft.hpp"
+#include "openvino/op/idft.hpp"
namespace cldnn {
GPU_DEFINE_PRIMITIVE_TYPE_ID(dft)
diff --git a/src/plugins/intel_gpu/src/graph/gather.cpp b/src/plugins/intel_gpu/src/graph/gather.cpp
index 7d503faf8a2..770c47f96f8 100644
--- a/src/plugins/intel_gpu/src/graph/gather.cpp
+++ b/src/plugins/intel_gpu/src/graph/gather.cpp
@@ -9,6 +9,7 @@
#include <string>
#include "gather_shape_inference.hpp"
+#include "openvino/op/gather.hpp"
namespace cldnn {
GPU_DEFINE_PRIMITIVE_TYPE_ID(gather)
diff --git a/src/plugins/intel_gpu/src/graph/reduce.cpp b/src/plugins/intel_gpu/src/graph/reduce.cpp
index 09c7e789139..b1ed990e54a 100644
--- a/src/plugins/intel_gpu/src/graph/reduce.cpp
+++ b/src/plugins/intel_gpu/src/graph/reduce.cpp
@@ -10,6 +10,15 @@
#include <string>
#include "reduce_shape_inference.hpp"
+#include "openvino/op/reduce_l1.hpp"
+#include "openvino/op/reduce_l2.hpp"
+#include "openvino/op/reduce_logical_and.hpp"
+#include "openvino/op/reduce_logical_or.hpp"
+#include "openvino/op/reduce_max.hpp"
+#include "openvino/op/reduce_mean.hpp"
+#include "openvino/op/reduce_min.hpp"
+#include "openvino/op/reduce_prod.hpp"
+#include "openvino/op/reduce_sum.hpp"
namespace cldnn {
GPU_DEFINE_PRIMITIVE_TYPE_ID(reduce)
diff --git a/src/plugins/intel_gpu/src/graph/roi_align.cpp b/src/plugins/intel_gpu/src/graph/roi_align.cpp
index 93896974d19..434333277ae 100644
--- a/src/plugins/intel_gpu/src/graph/roi_align.cpp
+++ b/src/plugins/intel_gpu/src/graph/roi_align.cpp
@@ -9,6 +9,7 @@
#include "openvino/core/enum_names.hpp"
#include "roi_align_shape_inference.hpp"
#include "roi_align_rotated_shape_inference.hpp"
+#include "openvino/op/roi_align_rotated.hpp"
namespace cldnn {
GPU_DEFINE_PRIMITIVE_TYPE_ID(roi_align)
diff --git a/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp b/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp
index 3dbec05dbbe..fb5baf43e1f 100644
--- a/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp
+++ b/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp
@@ -9,6 +9,7 @@
#include <string>
#include "scatter_nd_base_shape_inference.hpp"
+#include "openvino/op/scatter_nd_update.hpp"
namespace cldnn {
GPU_DEFINE_PRIMITIVE_TYPE_ID(scatter_nd_update)