Skip to content

Commit

Permalink
Remove include of all opsets in builders.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Dec 1, 2023
1 parent 1bfabe4 commit d683d4c
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class CustomOpCPUTest : public SubgraphBaseTest {
auto customOp = std::make_shared<CustomOp>(paramsOuts);
auto shapeOf = std::make_shared<ov::opset10::ShapeOf>(customOp->output(1));

ngraph::ResultVector results{std::make_shared<ov::opset3::Result>(customOp->output(0)),
std::make_shared<ov::opset3::Result>(shapeOf)};
ngraph::ResultVector results{std::make_shared<ov::op::v0::Result>(customOp->output(0)),
std::make_shared<ov::op::v0::Result>(shapeOf)};
function = std::make_shared<ngraph::Function>(results, inputParams, "customOpTest");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ReshapeChain : public SubgraphBaseTest {
auto reshapeParam4 = ngraph::builder::makeConstant<int>(secondInPrc, {2}, {4, -1});
auto reshape4 = std::make_shared<ov::opset1::Reshape>(reshape3, reshapeParam4, true);

ngraph::ResultVector results{std::make_shared<ov::opset3::Result>(reshape4)};
ngraph::ResultVector results{std::make_shared<ov::op::v0::Result>(reshape4)};
function = std::make_shared<ngraph::Function>(results, inputParams, "reshapeChain");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class SplitConcatAddInPlace : virtual public ov::test::SubgraphBaseTest {

auto add_const = ngraph::builder::makeConstant(precision, {1}, std::vector<float>({1.0f}));
auto add_1 = ngraph::builder::makeEltwise(split->output(0), add_const, ngraph::helpers::EltwiseTypes::ADD);
auto result_add_1 = std::make_shared<ov::opset3::Result>(add_1);
auto result_add_1 = std::make_shared<ov::op::v0::Result>(add_1);
auto add_2 = ngraph::builder::makeEltwise(split->output(1), add_const, ngraph::helpers::EltwiseTypes::ADD);
auto add_3 = ngraph::builder::makeEltwise(split->output(2), add_const, ngraph::helpers::EltwiseTypes::ADD);
auto concat = std::make_shared<ov::op::v0::Concat>(ov::NodeVector{add_1, add_2, add_3}, 1);
auto result_concat = std::make_shared<ov::opset3::Result>(concat);
auto result_concat = std::make_shared<ov::op::v0::Result>(concat);
auto add_4 = ngraph::builder::makeEltwise(concat, add_const, ngraph::helpers::EltwiseTypes::ADD);
auto add_5 = ngraph::builder::makeEltwise(concat, add_const, ngraph::helpers::EltwiseTypes::ADD);
auto result_1 = std::make_shared<ov::opset3::Result>(add_4);
auto result_2 = std::make_shared<ov::opset3::Result>(add_5);
auto result_1 = std::make_shared<ov::op::v0::Result>(add_4);
auto result_2 = std::make_shared<ov::op::v0::Result>(add_5);
ngraph::ResultVector results = {result_1, result_2, result_add_1, result_concat};
function = std::make_shared<ov::Model>(results, params, "Subgraph");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ class StaticZeroDims : public SubgraphBaseTest {
for (auto&& shape : inputDynamicShapes) {
inputParams.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, shape));
}
auto splitAxisOp = std::make_shared<ov::opset3::Constant>(ngraph::element::i64, ngraph::Shape{}, std::vector<int64_t>{0});
auto splitAxisOp = std::make_shared<ov::op::v0::Constant>(ngraph::element::i64, ngraph::Shape{}, std::vector<int64_t>{0});
std::vector<int> splitLenght = {1, 0, 6};
auto splitLengthsOp = std::make_shared<ov::opset3::Constant>(ngraph::element::i32, ngraph::Shape{splitLenght.size()}, splitLenght);
auto varSplit = std::make_shared<ov::opset3::VariadicSplit>(inputParams[0], splitAxisOp, splitLengthsOp);
auto splitLengthsOp = std::make_shared<ov::op::v0::Constant>(ngraph::element::i32, ngraph::Shape{splitLenght.size()}, splitLenght);
auto varSplit = std::make_shared<ov::op::v1::VariadicSplit>(inputParams[0], splitAxisOp, splitLengthsOp);

auto relu1 = std::make_shared<ov::opset5::Relu>(varSplit->output(0));
auto relu1 = std::make_shared<ov::op::v0::Relu>(varSplit->output(0));

auto numInRoi = ngraph::builder::makeConstant(ngPrc, {0}, std::vector<float>{}, false);
auto expDet = std::make_shared<ov::op::v6::ExperimentalDetectronTopKROIs>(varSplit->output(1), numInRoi, 10);
auto relu2 = std::make_shared<ov::opset5::Relu>(expDet);
auto relu2 = std::make_shared<ov::op::v0::Relu>(expDet);

auto relu3 = std::make_shared<ov::opset5::Relu>(varSplit->output(2));
auto relu3 = std::make_shared<ov::op::v0::Relu>(varSplit->output(2));

ngraph::NodeVector results{relu1, relu2, relu3};
function = std::make_shared<ngraph::Function>(results, inputParams, "StaticZeroDims");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class StridedSliceZeroDimsTest : public SubgraphBaseTest {
auto stride = builder::makeConstant(element::i64, {1}, std::vector<int64_t>{1});
auto indices = builder::makeConstant(element::i64, {1}, std::vector<int64_t>{1});
auto axes = builder::makeConstant(element::i64, {1}, std::vector<int64_t>{0});
auto shapeOf = std::make_shared<ov::opset9::ShapeOf>(inputParams[1]);
auto gather = std::make_shared<ov::opset9::Gather>(shapeOf, indices, axes);
auto shapeOf = std::make_shared<ov::op::v3::ShapeOf>(inputParams[1]);
auto gather = std::make_shared<ov::op::v8::Gather>(shapeOf, indices, axes);
auto strided_slice = std::make_shared<ov::op::v1::StridedSlice>(inputParams.front(),
gather,
end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GatherElementsGPUTest : public testing::WithParamInterface<GatherElementsP

auto gather = std::make_shared<ov::op::v6::GatherElements>(params[0], params[1], axis);

ngraph::ResultVector results{std::make_shared<ov::opset4::Result>(gather)};
ngraph::ResultVector results{std::make_shared<ov::op::v0::Result>(gather)};
function = std::make_shared<ngraph::Function>(results, params, "GatherElements");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,23 +449,23 @@ TEST_P(IEClassNetworkTestP, SetAffinityWithConstantBranches) {
{
ngraph::PartialShape shape({1, 84});
ngraph::element::Type type(ngraph::element::Type_t::f32);
auto param = std::make_shared<ov::opset6::Parameter>(type, shape);
auto param = std::make_shared<ov::op::v0::Parameter>(type, shape);
auto matMulWeights =
ov::opset6::Constant::create(ngraph::element::Type_t::f32, {10, 84}, {1});
auto shapeOf = std::make_shared<ov::opset6::ShapeOf>(matMulWeights);
auto gConst1 = ov::opset6::Constant::create(ngraph::element::Type_t::i32, {1}, {1});
auto gConst2 = ov::opset6::Constant::create(ngraph::element::Type_t::i64, {}, {0});
auto gather = std::make_shared<ov::opset6::Gather>(shapeOf, gConst1, gConst2);
auto concatConst = ov::opset6::Constant::create(ngraph::element::Type_t::i64, {1}, {1});
ov::op::v0::Constant::create(ngraph::element::Type_t::f32, {10, 84}, {1});
auto shapeOf = std::make_shared<ov::op::v0::ShapeOf>(matMulWeights);
auto gConst1 = ov::op::v0::Constant::create(ngraph::element::Type_t::i32, {1}, {1});
auto gConst2 = ov::op::v0::Constant::create(ngraph::element::Type_t::i64, {}, {0});
auto gather = std::make_shared<ov::op::v1::Gather>(shapeOf, gConst1, gConst2);
auto concatConst = ov::op::v0::Constant::create(ngraph::element::Type_t::i64, {1}, {1});
auto concat =
std::make_shared<ov::opset6::Concat>(ngraph::NodeVector{concatConst, gather}, 0);
auto relu = std::make_shared<ov::opset6::Relu>(param);
auto reshape = std::make_shared<ov::opset6::Reshape>(relu, concat, false);
auto matMul = std::make_shared<ov::opset6::MatMul>(reshape, matMulWeights, false, true);
std::make_shared<ov::op::v0::Concat>(ngraph::NodeVector{concatConst, gather}, 0);
auto relu = std::make_shared<ov::op::v0::Relu>(param);
auto reshape = std::make_shared<ov::op::v1::Reshape>(relu, concat, false);
auto matMul = std::make_shared<ov::op::v0::MatMul>(reshape, matMulWeights, false, true);
auto matMulBias =
ov::opset6::Constant::create(ngraph::element::Type_t::f32, {1, 10}, {1});
auto addBias = std::make_shared<ov::opset6::Add>(matMul, matMulBias);
auto result = std::make_shared<ov::opset6::Result>(addBias);
ov::op::v0::Constant::create(ngraph::element::Type_t::f32, {1, 10}, {1});
auto addBias = std::make_shared<ov::op::v1::Add>(matMul, matMulBias);
auto result = std::make_shared<ov::op::v0::Result>(addBias);

ngraph::ParameterVector params = {param};
ngraph::ResultVector results = {result};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class GroupNormalizationTest : public testing::WithParamInterface<GroupNormaliza
params.at(2),
num_groups,
epsilon);
const ngraph::ResultVector results{std::make_shared<ov::opset8::Result>(groupNormalization)};
const ngraph::ResultVector results{std::make_shared<ov::op::v0::Result>(groupNormalization)};

// TODO: This workaround is needed as there is no full support for f16 type in the reference implementation
if (ngPrc == element::Type_t::f16) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace test {
namespace subgraph {

namespace {
std::ostream& operator <<(std::ostream& ss, const ov::opset6::ExperimentalDetectronDetectionOutput::Attributes& attributes) {
std::ostream& operator <<(std::ostream& ss, const ov::op::v6::ExperimentalDetectronDetectionOutput::Attributes& attributes) {
ss << "score_threshold=" << attributes.score_threshold << "_";
ss << "nms_threshold=" << attributes.nms_threshold << "_";
ss << "max_delta_log_wh=" << attributes.max_delta_log_wh << "_";
Expand All @@ -28,7 +28,7 @@ namespace {
std::string ExperimentalDetectronDetectionOutputLayerTest::getTestCaseName(
const testing::TestParamInfo<ExperimentalDetectronDetectionOutputTestParams>& obj) {
std::vector<ov::test::InputShape> inputShapes;
ov::opset6::ExperimentalDetectronDetectionOutput::Attributes attributes;
ov::op::v6::ExperimentalDetectronDetectionOutput::Attributes attributes;
ElementType netPrecision;
std::string targetName;
std::tie(
Expand Down Expand Up @@ -61,7 +61,7 @@ std::string ExperimentalDetectronDetectionOutputLayerTest::getTestCaseName(

void ExperimentalDetectronDetectionOutputLayerTest::SetUp() {
std::vector<InputShape> inputShapes;
ov::opset6::ExperimentalDetectronDetectionOutput::Attributes attributes;
ov::op::v6::ExperimentalDetectronDetectionOutput::Attributes attributes;

ElementType netPrecision;
std::string targetName;
Expand Down Expand Up @@ -90,7 +90,7 @@ void ExperimentalDetectronDetectionOutputLayerTest::SetUp() {
for (auto&& shape : inputDynamicShapes)
params.push_back(std::make_shared<ov::op::v0::Parameter>(netPrecision, shape));

auto experimentalDetectron = std::make_shared<ov::opset6::ExperimentalDetectronDetectionOutput>(
auto experimentalDetectron = std::make_shared<ov::op::v6::ExperimentalDetectronDetectionOutput>(
params[0], // input_rois
params[1], // input_deltas
params[2], // input_scores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void MultinomialTest::SetUp() {
params.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, shape));
}

auto numSamplesConstant = std::make_shared<ov::opset3::Constant>(
auto numSamplesConstant = std::make_shared<ov::op::v0::Constant>(
ngraph::element::Type_t::i64, ov::Shape{1}, numSamples);
const auto paramOuts =
ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(params));
Expand Down
11 changes: 0 additions & 11 deletions src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@
#include <memory>
#include <vector>

Check warning on line 8 in src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp

View workflow job for this annotation

GitHub Actions / clang-format

[reviewdog-suggester] reported by reviewdog 🐶 Raw Output: src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp:8:-#include <vector> src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp:9:-

// TODO: Temporary solution to fix compilation of plugin tests
#include <openvino/opsets/opset1.hpp>
#include <openvino/opsets/opset2.hpp>
#include <openvino/opsets/opset3.hpp>
#include <openvino/opsets/opset4.hpp>
#include <openvino/opsets/opset5.hpp>
#include <openvino/opsets/opset6.hpp>
#include <openvino/opsets/opset7.hpp>
#include <openvino/opsets/opset8.hpp>
#include <openvino/opsets/opset9.hpp>
#include <ov_models/utils/ov_helpers.hpp>
// TODO: Temporary solution to fix compilation of plugin tests

Check warning on line 11 in src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp

View workflow job for this annotation

GitHub Actions / clang-format

[reviewdog-suggester] reported by reviewdog 🐶 Raw Output: src/tests/ov_helpers/ov_models/include/ov_models/builders.hpp:9:+#include <vector>
#include "common_test_utils/test_enums.hpp"
#include "openvino/core/node.hpp"
Expand Down

0 comments on commit d683d4c

Please sign in to comment.