Skip to content

Commit a16bc97

Browse files
authored
[core] Remove ngraph/output_vector API (openvinotoolkit#22446)
* Remove ngraph/output_vector API * Fix build issue
1 parent 8922564 commit a16bc97

File tree

355 files changed

+673
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

355 files changed

+673
-692
lines changed

src/common/transformations/tests/common_optimizations/ngraph_fq_transpose_test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ TEST_F(TransformationTestsF, FQTransposeTest1) {
3737
auto fq = std::make_shared<ov::op::v0::FakeQuantize>(data, input_low, input_high, output_low, output_high, 1);
3838
auto transpose = std::make_shared<ov::op::v1::Transpose>(fq, transpose_order);
3939

40-
model = std::make_shared<ov::Model>(NodeVector{transpose}, ParameterVector{});
40+
model = std::make_shared<ov::Model>(ov::NodeVector{transpose}, ParameterVector{});
4141

4242
manager.register_pass<ov::pass::PullTransposeThroughFQUp>();
4343
manager.register_pass<ov::pass::InjectionPass>([](std::shared_ptr<ov::Model> f) {
@@ -54,7 +54,7 @@ TEST_F(TransformationTestsF, FQTransposeTest1) {
5454

5555
auto fq = std::make_shared<ov::op::v0::FakeQuantize>(data, input_low, input_high, output_low, output_high, 1);
5656

57-
model_ref = std::make_shared<ov::Model>(NodeVector{fq}, ParameterVector{});
57+
model_ref = std::make_shared<ov::Model>(ov::NodeVector{fq}, ParameterVector{});
5858
}
5959
}
6060

@@ -72,7 +72,7 @@ TEST_F(TransformationTestsF, FQTransposeNegativeCase) {
7272
std::make_shared<ov::op::v0::FakeQuantize>(sigmoid, input_low, input_high, output_low, output_high, 1);
7373
auto transpose = std::make_shared<ov::op::v1::Transpose>(fq, transpose_order);
7474

75-
return std::make_shared<ov::Model>(NodeVector{transpose}, ParameterVector{data});
75+
return std::make_shared<ov::Model>(ov::NodeVector{transpose}, ParameterVector{data});
7676
};
7777
model = create_graph();
7878

src/common/transformations/tests/op_conversions/ngraph_depth_to_space_transform_test.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TEST(TransformationTests, TestDepthToSpaceTransformBlockFirst) {
2929
{
3030
auto depth_to_space =
3131
std::make_shared<op::v0::DepthToSpace>(input, op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST, 2);
32-
f = std::make_shared<ov::Model>(NodeVector{depth_to_space}, ParameterVector{input});
32+
f = std::make_shared<ov::Model>(ov::NodeVector{depth_to_space}, ParameterVector{input});
3333
pass::Manager m;
3434
m.register_pass<ov::pass::InitNodeInfo>();
3535
m.register_pass<ov::pass::ConvertDepthToSpace>();
@@ -73,7 +73,7 @@ TEST(TransformationTests, TestDepthToSpaceTransformDepthFirst) {
7373
{
7474
auto depth_to_space =
7575
std::make_shared<op::v0::DepthToSpace>(input, op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST, 2);
76-
f = std::make_shared<ov::Model>(NodeVector{depth_to_space}, ParameterVector{input});
76+
f = std::make_shared<ov::Model>(ov::NodeVector{depth_to_space}, ParameterVector{input});
7777
pass::Manager m;
7878
m.register_pass<ov::pass::InitNodeInfo>();
7979
m.register_pass<ov::pass::ConvertDepthToSpace>();
@@ -117,7 +117,7 @@ TEST(TransformationTests, TestSpaceToDepthTransformBlockFirst) {
117117
{
118118
auto space_to_depth =
119119
std::make_shared<op::v0::SpaceToDepth>(input, op::v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST, 2);
120-
f = std::make_shared<ov::Model>(NodeVector{space_to_depth}, ParameterVector{input});
120+
f = std::make_shared<ov::Model>(ov::NodeVector{space_to_depth}, ParameterVector{input});
121121
pass::Manager m;
122122
m.register_pass<ov::pass::InitNodeInfo>();
123123
m.register_pass<ov::pass::ConvertSpaceToDepth>();
@@ -161,7 +161,7 @@ TEST(TransformationTests, TestSpaceToDepthTransformDepthFirst) {
161161
{
162162
auto space_to_depth =
163163
std::make_shared<op::v0::SpaceToDepth>(input, op::v0::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST, 2);
164-
f = std::make_shared<ov::Model>(NodeVector{space_to_depth}, ParameterVector{input});
164+
f = std::make_shared<ov::Model>(ov::NodeVector{space_to_depth}, ParameterVector{input});
165165
pass::Manager m;
166166
m.register_pass<ov::pass::InitNodeInfo>();
167167
m.register_pass<ov::pass::ConvertSpaceToDepth>();
@@ -205,7 +205,7 @@ TEST(TransformationTests, TestSpaceToDepthDynamic) {
205205
{
206206
auto space_to_depth =
207207
std::make_shared<op::v0::SpaceToDepth>(input, op::v0::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST, 2);
208-
f = std::make_shared<ov::Model>(NodeVector{space_to_depth}, ParameterVector{input});
208+
f = std::make_shared<ov::Model>(ov::NodeVector{space_to_depth}, ParameterVector{input});
209209
pass::Manager m;
210210
m.register_pass<ov::pass::ConvertSpaceToDepth>();
211211
ASSERT_NO_THROW(m.run_passes(f));
@@ -219,7 +219,7 @@ TEST(TransformationTests, TestDepthToSpaceDynamic) {
219219
{
220220
auto depth_to_space =
221221
std::make_shared<op::v0::DepthToSpace>(input, op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST, 2);
222-
f = std::make_shared<ov::Model>(NodeVector{depth_to_space}, ParameterVector{input});
222+
f = std::make_shared<ov::Model>(ov::NodeVector{depth_to_space}, ParameterVector{input});
223223
pass::Manager m;
224224
m.register_pass<ov::pass::ConvertDepthToSpace>();
225225
ASSERT_NO_THROW(m.run_passes(f));

src/common/transformations/tests/op_conversions/ngraph_mode_decomposition_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TEST(TransformationTests, ModDecompositionTests) {
3030
{
3131
auto mod = std::make_shared<op::v1::Mod>(data1, data2);
3232

33-
f = std::make_shared<ov::Model>(NodeVector{mod}, ParameterVector{});
33+
f = std::make_shared<ov::Model>(ov::NodeVector{mod}, ParameterVector{});
3434
auto unh = std::make_shared<ov::pass::UniqueNamesHolder>();
3535
pass::Manager m;
3636
m.register_pass<ov::pass::InitUniqueNames>(unh);

src/core/include/ngraph/graph_util.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ using ov::traverse_nodes;
5555

5656
NGRAPH_API_DEPRECATED
5757
NGRAPH_API
58-
NodeVector find_common_args(std::shared_ptr<Node> target, std::shared_ptr<Node> replacement);
58+
ov::NodeVector find_common_args(std::shared_ptr<Node> target, std::shared_ptr<Node> replacement);
5959

6060
/// Topological sort of just nodes
6161
template <typename T>
@@ -169,17 +169,17 @@ bool is_zero(const ov::Output<Node>& reduce_constant);
169169

170170
NGRAPH_API_DEPRECATED
171171
NGRAPH_API
172-
NodeVector get_subgraph_outputs(const NodeVector& nodes,
173-
const NodeVector& exclusions,
174-
bool ignore_unused = false,
175-
bool ignore_output_duplicates = true);
172+
ov::NodeVector get_subgraph_outputs(const ov::NodeVector& nodes,
173+
const ov::NodeVector& exclusions,
174+
bool ignore_unused = false,
175+
bool ignore_output_duplicates = true);
176176

177177
// Extract sub-graph computing the `results`. Stops backward traversal at either a Parameter
178178
// node
179179
// or a node that belongs to args
180180
NGRAPH_API_DEPRECATED
181181
NGRAPH_API
182-
NodeVector extract_subgraph(const NodeVector& results, const NodeVector& args);
182+
ov::NodeVector extract_subgraph(const ov::NodeVector& results, const ov::NodeVector& args);
183183

184184
NGRAPH_API_DEPRECATED
185185
NGRAPH_API
@@ -226,7 +226,7 @@ std::vector<ov::Output<Node>> get_outputs_to(Node& src, Node& dst);
226226
/// It returns true if a cycle is found and the first cycle encountered.
227227
NGRAPH_API_DEPRECATED
228228
NGRAPH_API
229-
bool check_for_cycles(const ov::Model* func, ngraph::NodeVector& cycle_nodes, bool& is_bkwd_cycle);
229+
bool check_for_cycles(const ov::Model* func, ov::NodeVector& cycle_nodes, bool& is_bkwd_cycle);
230230
} // namespace ngraph
231231

232232
using ngraph::replace_node;

src/core/include/ngraph/node.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
#include "ngraph/coordinate_diff.hpp"
3333
#include "ngraph/deprecated.hpp"
3434
#include "ngraph/op/util/attr_types.hpp"
35-
#include "ngraph/output_vector.hpp"
3635
#include "ngraph/strides.hpp"
3736
#include "openvino/core/any.hpp"
3837
#include "openvino/core/descriptor/input.hpp"
3938
#include "openvino/core/descriptor/output.hpp"
4039
#include "openvino/core/descriptor/tensor.hpp"
4140
#include "openvino/core/node.hpp"
41+
#include "openvino/core/node_vector.hpp"
4242
#include "openvino/op/util/variable.hpp"
4343
#include "openvino/op/util/variable_value.hpp"
4444

@@ -69,7 +69,7 @@ NGRAPH_API_DEPRECATED
6969
const std::shared_ptr<Node>& check_single_output_arg(const std::shared_ptr<Node>& node, size_t i);
7070
NGRAPH_API
7171
NGRAPH_API_DEPRECATED
72-
const NodeVector& check_single_output_args(const NodeVector& args);
72+
const ov::NodeVector& check_single_output_args(const ov::NodeVector& args);
7373

7474
const auto as_output_vector = ov::as_output_vector;
7575
const auto as_node_vector = ov::as_node_vector;

src/core/include/ngraph/output_vector.hpp

-26
This file was deleted.

src/core/include/ngraph/util.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,5 +283,5 @@ std::vector<int64_t> NGRAPH_API read_index_vector(std::shared_ptr<ov::Tensor> tv
283283

284284
NGRAPH_API
285285
NGRAPH_API_DEPRECATED
286-
std::ostream& operator<<(std::ostream& os, const ngraph::NodeVector& nv);
286+
std::ostream& operator<<(std::ostream& os, const ov::NodeVector& nv);
287287
NGRAPH_SUPPRESS_DEPRECATED_END

src/core/src/graph_util.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,17 @@ ov::NodeVector find_common_args(std::shared_ptr<Node> node1, std::shared_ptr<Nod
352352
node1_args.insert(node);
353353
};
354354

355-
traverse_nodes({std::move(node1)}, compute_node1_args, NodeVector{});
355+
traverse_nodes({std::move(node1)}, compute_node1_args, ov::NodeVector{});
356356

357357
std::unordered_set<std::shared_ptr<Node>> node2_args;
358358

359359
auto compute_node2_args = [&node2_args](const std::shared_ptr<Node>& node) {
360360
node2_args.insert(node);
361361
};
362362

363-
traverse_nodes({std::move(node2)}, compute_node2_args, NodeVector{});
363+
traverse_nodes({std::move(node2)}, compute_node2_args, ov::NodeVector{});
364364

365-
NodeVector common_args;
365+
ov::NodeVector common_args;
366366
for (const auto& e : node1_args) {
367367
if (node2_args.count(e) > 0) {
368368
common_args.push_back(e);
@@ -403,7 +403,7 @@ std::vector<std::shared_ptr<ov::Node>> clone_nodes(const std::vector<std::shared
403403
for (const auto& node : sorted_nodes) {
404404
if (node_map.count(node.get()) == 0) {
405405
// get (already) cloned arguments and clone the node
406-
OutputVector cloned_args;
406+
ov::OutputVector cloned_args;
407407
for (auto input : node->inputs()) {
408408
ov::Output<Node> output = input.get_source_output();
409409
cloned_args.push_back(output.for_node(node_map.at(output.get_node())));
@@ -458,11 +458,11 @@ std::list<std::shared_ptr<ov::Node>> clone_nodes(const std::vector<std::shared_p
458458
if (output_map.count(value) == 0) {
459459
// We need this node cloned
460460
// get (already) cloned arguments and clone the node
461-
OutputVector cloned_args;
461+
ov::OutputVector cloned_args;
462462
for (const auto& value : node->input_values()) {
463463
cloned_args.push_back(output_map.at(value));
464464
}
465-
NodeVector cloned_dependencies;
465+
ov::NodeVector cloned_dependencies;
466466
for (auto& dependency : node->get_control_dependencies()) {
467467
for (const auto& dependency_value : dependency->outputs()) {
468468
std::shared_ptr<Node> dependent = output_map.at(dependency_value).get_node_shared_ptr();
@@ -636,14 +636,14 @@ bool is_one(const ov::Output<Node>& reduce_constant) {
636636
return result_bool;
637637
}
638638

639-
ov::NodeVector get_subgraph_outputs(const NodeVector& nodes,
640-
const NodeVector& exclusions,
639+
ov::NodeVector get_subgraph_outputs(const ov::NodeVector& nodes,
640+
const ov::NodeVector& exclusions,
641641
bool ignore_unused,
642642
bool ignore_output_duplicates) {
643643
std::set<std::shared_ptr<Node>> exclusions_set(exclusions.begin(), exclusions.end());
644644
std::set<std::shared_ptr<Node>> nodes_set(nodes.begin(), nodes.end());
645645

646-
NodeVector outputs;
646+
ov::NodeVector outputs;
647647

648648
for (const auto& n : nodes) {
649649
if (exclusions_set.count(n) != 0) {
@@ -662,8 +662,8 @@ ov::NodeVector get_subgraph_outputs(const NodeVector& nodes,
662662
return outputs;
663663
}
664664

665-
ov::NodeVector extract_subgraph(const NodeVector& results, const NodeVector& args) {
666-
NodeVector subgraph;
665+
ov::NodeVector extract_subgraph(const ov::NodeVector& results, const ov::NodeVector& args) {
666+
ov::NodeVector subgraph;
667667
traverse_nodes(
668668
results,
669669
[&](const std::shared_ptr<Node>& n) {

src/core/src/node.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ const std::shared_ptr<ov::Node>& ngraph::check_single_output_arg(const std::shar
535535
return node;
536536
}
537537

538-
const ov::NodeVector& ngraph::check_single_output_args(const NodeVector& args) {
538+
const ov::NodeVector& ngraph::check_single_output_args(const ov::NodeVector& args) {
539539
for (size_t i = 0; i < args.size(); ++i) {
540540
ngraph::check_single_output_arg(args.at(i), i);
541541
}

src/core/src/specialize_function.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ std::shared_ptr<ov::Model> ngraph::specialize_function(std::shared_ptr<ov::Model
5050
continue;
5151
}
5252

53-
OutputVector new_args;
53+
ov::OutputVector new_args;
5454
for (auto input : old_node->inputs()) {
5555
auto output = input.get_source_output();
5656
new_args.push_back(output.for_node(m[output.get_node()]));
5757
}
5858

59-
NodeVector cloned_dependencies;
59+
ov::NodeVector cloned_dependencies;
6060
for (auto& dependency : old_node->get_control_dependencies()) {
6161
std::shared_ptr<Node> dependent = m.at(dependency.get());
6262
if (find(cloned_dependencies.begin(), cloned_dependencies.end(), dependent) == cloned_dependencies.end()) {

src/frontends/common/dev_api/openvino/frontend/common/random_normal_helper.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#pragma once
66

7-
#include "ngraph/output_vector.hpp"
7+
#include "openvino/core/node_vector.hpp"
88
#include "openvino/frontend/visibility.hpp"
99
#include "openvino/pass/graph_rewrite.hpp"
1010

src/frontends/common/src/random_normal_helper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <math.h>
99

10-
#include "ngraph/output_vector.hpp"
10+
#include "openvino/core/node_vector.hpp"
1111
#include "openvino/op/constant.hpp"
1212
#include "openvino/opsets/opset12.hpp"
1313
#include "openvino/pass/graph_rewrite.hpp"

src/frontends/onnx/docs/how_to_add_op.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace onnx_import {
1717
namespace op {
1818
namespace set_1 {
1919

20-
OutputVector custom_add(const Node& node);
20+
ov::OutputVector custom_add(const Node& node);
2121

2222
} // namespace set_1
2323
} // namespace op
@@ -38,7 +38,7 @@ namespace onnx_import {
3838
namespace op {
3939
namespace set_1 {
4040
41-
OutputVector custom_add(const Node& node) {
41+
ov::OutputVector custom_add(const Node& node) {
4242
const auto in1 = node.get_ng_inputs().at(0);
4343
const auto in2 = node.get_ng_inputs().at(1);
4444
const auto alpha = node.get_attribute_value<float>("alpha", 1);

src/frontends/onnx/frontend/include/onnx_import/core/node.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NGRAPH_API_DEPRECATED ONNX_IMPORTER_API Node {
6565
Node& operator=(Node&&) noexcept = delete;
6666
Node& operator=(const Node&) = delete;
6767

68-
OutputVector get_ng_inputs() const;
68+
ov::OutputVector get_ng_inputs() const;
6969
const std::string& domain() const;
7070
const std::string& op_type() const;
7171
const std::string& get_name() const;

src/frontends/onnx/frontend/include/onnx_import/core/operator_set.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace ngraph {
1414
namespace onnx_import {
1515
/// \brief Function which transforms single ONNX operator to nGraph sub-graph.
1616
OPENVINO_SUPPRESS_DEPRECATED_START
17-
using Operator = std::function<OutputVector(const Node&)>;
17+
using Operator = std::function<ov::OutputVector(const Node&)>;
1818
OPENVINO_SUPPRESS_DEPRECATED_END
1919

2020
/// \brief Map which contains ONNX operators accessible by std::string value as a key.

src/frontends/onnx/frontend/include/openvino/frontend/onnx/node_context.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ class ONNX_FRONTEND_API NodeContext : public ov::frontend::NodeContext {
3232

3333
protected:
3434
const ngraph::onnx_import::Node& m_context;
35-
OutputVector m_inputs;
35+
ov::OutputVector m_inputs;
3636

3737
private:
3838
ov::Any apply_additional_conversion_rules(const ov::Any& data, const std::type_info& type_info) const override;
3939
};
40-
using CreatorFunction = std::function<OutputVector(const ngraph::onnx_import::Node&)>;
40+
using CreatorFunction = std::function<ov::OutputVector(const ngraph::onnx_import::Node&)>;
4141
} // namespace onnx
4242
} // namespace frontend
4343
} // namespace ov

0 commit comments

Comments
 (0)