Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up of tests/ov_helpers leftovers #21416

Merged
merged 17 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ std::shared_ptr<ngraph::Function> getFunction2() {

auto in2add = ngraph::builder::makeConstant(ngPrc, {1, 2, 1, 1}, std::vector<float>{}, true);
auto add = ngraph::builder::makeEltwise(split->output(0), in2add, ngraph::helpers::EltwiseTypes::ADD);
auto relu1 = std::make_shared<ngraph::opset1::Relu>(add);
auto relu1 = std::make_shared<ov::op::v0::Relu>(add);

auto in2mult = ngraph::builder::makeConstant(ngPrc, {1, 2, 1, 1}, std::vector<float>{}, true);
auto mult = ngraph::builder::makeEltwise(split->output(1), in2mult, ngraph::helpers::EltwiseTypes::MULTIPLY);
auto relu2 = std::make_shared<ngraph::opset1::Relu>(mult);
auto relu2 = std::make_shared<ov::op::v0::Relu>(mult);

auto concat = std::make_shared<ngraph::opset1::Concat>(ngraph::OutputVector{relu1->output(0), relu2->output(0)}, 3);
auto concat = std::make_shared<ov::op::v0::Concat>(ngraph::OutputVector{relu1->output(0), relu2->output(0)}, 3);
concat->get_output_tensor(0).set_names({"concat"});

return std::make_shared<ngraph::Function>(concat, params, "SplitAddConcat");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ std::shared_ptr<ngraph::Function> getFunction1() {

auto in2add = ngraph::builder::makeConstant(ngPrc, {1, 4, 1, 1}, std::vector<float>{}, true);
auto add = ngraph::builder::makeEltwise(params[0], in2add, ngraph::helpers::EltwiseTypes::ADD);
auto relu1 = std::make_shared<ngraph::opset1::Relu>(add->output(0));
auto relu1 = std::make_shared<ov::op::v0::Relu>(add->output(0));
relu1->get_output_tensor(0).set_names({"relu1"});
auto relu2 = std::make_shared<ngraph::opset1::Relu>(add->output(0));
auto relu2 = std::make_shared<ov::op::v0::Relu>(add->output(0));
relu2->get_output_tensor(0).set_names({"relu2"});

ngraph::NodeVector results{relu1, relu2};
Expand All @@ -51,13 +51,13 @@ std::shared_ptr<ngraph::Function> getFunction2() {

auto in2add = ngraph::builder::makeConstant(ngPrc, {1, 2, 1, 1}, std::vector<float>{}, true);
auto add = ngraph::builder::makeEltwise(split->output(0), in2add, ngraph::helpers::EltwiseTypes::ADD);
auto relu1 = std::make_shared<ngraph::opset1::Relu>(add);
auto relu1 = std::make_shared<ov::op::v0::Relu>(add);

auto in2mult = ngraph::builder::makeConstant(ngPrc, {1, 2, 1, 1}, std::vector<float>{}, true);
auto mult = ngraph::builder::makeEltwise(split->output(1), in2mult, ngraph::helpers::EltwiseTypes::MULTIPLY);
auto relu2 = std::make_shared<ngraph::opset1::Relu>(mult);
auto relu2 = std::make_shared<ov::op::v0::Relu>(mult);

auto concat = std::make_shared<ngraph::opset1::Concat>(ngraph::OutputVector{relu1->output(0), relu2->output(0)}, 3);
auto concat = std::make_shared<ov::op::v0::Concat>(ngraph::OutputVector{relu1->output(0), relu2->output(0)}, 3);
concat->get_output_tensor(0).set_names({"concat"});

return std::make_shared<ngraph::Function>(concat, params, "SplitAddConcat");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,37 @@ namespace {
};

static std::shared_ptr<ngraph::Function> simple_function_non_max_suppression_internal(ngraph::element::Type, size_t) {
auto boxes = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1, 1000});
auto max_output_boxes_per_class = opset1::Constant::create(element::i32, Shape{1}, {10});
auto iou_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.75});
auto score_threshold = opset1::Constant::create(element::f32, Shape{1}, {0.7});
auto boxes = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1, 1000});
auto max_output_boxes_per_class = ov::op::v0::Constant::create(element::i32, Shape{1}, {10});
auto iou_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.75});
auto score_threshold = ov::op::v0::Constant::create(element::f32, Shape{1}, {0.7});
auto nms = std::make_shared<ov::op::internal::NonMaxSuppressionIEInternal>(boxes, scores, max_output_boxes_per_class,
iou_threshold, score_threshold, 0, true, element::i32);
auto res = std::make_shared<ngraph::opset6::Result>(nms);
auto res = std::make_shared<ov::op::v0::Result>(nms);
auto func = std::make_shared<Function>(NodeVector{nms}, ParameterVector{boxes, scores});
return func;
}

static std::shared_ptr<ngraph::Function> simple_function_matrix_nms_internal(ngraph::element::Type, size_t) {
auto boxes = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1, 1000});
auto boxes = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1, 1000});
ov::op::v8::MatrixNms::Attributes attr;
// convert_precision does not support internal op 'NmsStaticShapeIE'
attr.output_type = element::i32;
auto nms = std::make_shared<ov::op::internal::NmsStaticShapeIE<ov::op::v8::MatrixNms>>(boxes, scores, attr);
auto res = std::make_shared<ngraph::opset6::Result>(nms);
auto res = std::make_shared<ov::op::v0::Result>(nms);
auto func = std::make_shared<Function>(NodeVector{nms}, ParameterVector{boxes, scores});
return func;
}

static std::shared_ptr<ngraph::Function> simple_function_multiclass_nms_internal(ngraph::element::Type, size_t) {
auto boxes = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 1, 1000});
op::util::MulticlassNmsBase::Attributes attr;
auto boxes = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1000, 4});
auto scores = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 1, 1000});
ov::op::util::MulticlassNmsBase::Attributes attr;
attr.output_type = element::i32;
auto nms = std::make_shared<ov::op::internal::MulticlassNmsIEInternal>(boxes, scores, attr);
auto res = std::make_shared<ngraph::opset6::Result>(nms);
auto res = std::make_shared<ov::op::v0::Result>(nms);
auto func = std::make_shared<Function>(NodeVector{nms}, ParameterVector{boxes, scores});
return func;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ inline InferenceEngine::CNNNetwork getTargetNetwork() {
auto input = std::make_shared<op::v0::Parameter>(type, shape);
auto mem_i = std::make_shared<op::v0::Constant>(type, shape, 0);
auto mem_r = std::make_shared<op::v3::ReadValue>(mem_i, "id");
auto mul = std::make_shared<ngraph::op::v1::Multiply>(mem_r, input);
auto mul = std::make_shared<ov::op::v1::Multiply>(mem_r, input);
auto mem_w = std::make_shared<op::v3::Assign>(mul, "id");
auto sigm = std::make_shared<ngraph::op::Sigmoid>(mul);
mem_r->set_friendly_name("Memory");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const std::vector<ConcatTransformationTestValues> testValues = {
{},
{ 256ul, ngraph::Shape({}), {0.f}, {2.55f}, {0.f}, {2.55f} },
{},
std::make_shared<ngraph::opset1::Constant>(ov::element::u8, ov::Shape{1, 3, 16, 16}, std::vector<float>(3 * 16 * 16, 1.0)),
std::make_shared<ov::op::v0::Constant>(ov::element::u8, ov::Shape{1, 3, 16, 16}, std::vector<float>(3 * 16 * 16, 1.0)),
{},
{
{ ov::element::f16 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@

using namespace LayerTestsDefinitions;
using namespace InferenceEngine::details;
using namespace ngraph::opset1;

namespace {
const std::vector<ngraph::element::Type> precisions = {
ngraph::element::f32,
// ngraph::element::f16
};

const std::vector<DepthToSpace::DepthToSpaceMode> modes = {
DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST,
DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
const std::vector<ov::op::v0::DepthToSpace::DepthToSpaceMode> modes = {
ov::op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST,
ov::op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
};

const std::vector<ngraph::PartialShape> inputShapesBS2 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const std::vector<ov::element::Type> model_types = {
ov::element::i16,
};

const std::vector<DepthToSpace::DepthToSpaceMode> modes = {
DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST,
DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
const std::vector<ov::op::v0::DepthToSpace::DepthToSpaceMode> modes = {
ov::op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST,
ov::op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
};

const std::vector<std::vector<ov::Shape>> input_shapes_bs2_static = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ std::string ConvolutionLayerCPUTest::getTestCaseName(const testing::TestParamInf
InputShape inputShape;
std::string targetDevice;
std::tie(convParams, netType, inType, outType, inputShape, targetDevice) = basicParamsSet;
ngraph::op::PadType padType;
ov::op::PadType padType;
InferenceEngine::SizeVector kernel, stride, dilation;
std::vector<ptrdiff_t> padBegin, padEnd;
size_t convOutChannels;
Expand Down Expand Up @@ -93,11 +93,11 @@ void ConvolutionLayerCPUTest::checkBiasFusing(ov::CompiledModel& execNet) const
ASSERT_TRUE(foundConv) << "Can't find Convolution node";
}

std::shared_ptr<ngraph::Node> ConvolutionLayerCPUTest::modifyGraph(const ngraph::element::Type& ngPrc,
ngraph::ParameterVector& params,
const std::shared_ptr<ngraph::Node>& lastNode) {
std::shared_ptr<ov::Node> ConvolutionLayerCPUTest::modifyGraph(const ov::element::Type& ngPrc,
ov::ParameterVector& params,
const std::shared_ptr<ov::Node>& lastNode) {
auto retNode = CpuTestWithFusing::modifyGraph(ngPrc, params, lastNode);
std::shared_ptr<ngraph::Node> opToShapeInfer = nullptr;
std::shared_ptr<ov::Node> opToShapeInfer = nullptr;
for (auto& targetShapes : targetStaticShapes) {
for (size_t i = targetShapes.size(); i < params.size(); ++i) {
const auto& shape = params[i]->get_output_partial_shape(0);
Expand All @@ -109,13 +109,13 @@ std::shared_ptr<ngraph::Node> ConvolutionLayerCPUTest::modifyGraph(const ngraph:
// operation, and it has to match the convolution output shape. So the most suitable solution here is to
// perform shape inference on the convolution node
if (!opToShapeInfer) {
ngraph::OutputVector inputsForShapeInfer;
ov::OutputVector inputsForShapeInfer;
for (size_t j = 0; j < lastNode->get_input_size(); j++) {
if (ngraph::is_type<ngraph::opset1::Constant>(lastNode->get_input_node_ptr(j))) {
if (ov::is_type<ov::op::v0::Constant>(lastNode->get_input_node_ptr(j))) {
inputsForShapeInfer.push_back(lastNode->get_input_node_shared_ptr(j));
} else {
inputsForShapeInfer.push_back(
std::make_shared<ngraph::opset1::Parameter>(lastNode->get_input_element_type(j),
std::make_shared<ov::op::v0::Parameter>(lastNode->get_input_element_type(j),
lastNode->get_input_partial_shape(j)));
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void ConvolutionLayerCPUTest::SetUp() {
selectedType = makeSelectedTypeStr(selectedType, netType);
}

ngraph::op::PadType padType;
ov::op::PadType padType;
InferenceEngine::SizeVector stride;
std::vector<ptrdiff_t> padBegin, padEnd;
size_t convOutChannels;
Expand Down Expand Up @@ -636,7 +636,7 @@ const convParams_ExplicitPaddingType& convParams_ExplicitPadding_GEMM_2D() {
::testing::ValuesIn(padEnds2d()),
::testing::ValuesIn(dilations2d()),
::testing::ValuesIn(numOutChannels_Gemm()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_GEMM_2D;
}

Expand All @@ -648,7 +648,7 @@ const convParams_ExplicitPaddingDilatedType& convParams_ExplicitPadding_GEMM_2D_
::testing::ValuesIn(padEnds2d()),
::testing::Values(SizeVector{2, 2}),
::testing::ValuesIn(numOutChannels_Gemm()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_GEMM_2D_dilated;
}

Expand All @@ -660,7 +660,7 @@ const convParams_ExplicitPaddingType& convParams_ExplicitPadding_GEMM_1D() {
::testing::ValuesIn(padEnds1d()),
::testing::ValuesIn(dilations1d()),
::testing::ValuesIn(numOutChannels_Gemm()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_GEMM_1D;
}

Expand All @@ -672,7 +672,7 @@ const convParams_ExplicitPaddingType& convParams_ExplicitPadding_2D() {
::testing::ValuesIn(padEnds2d()),
::testing::ValuesIn(dilations2d()),
::testing::ValuesIn(numOutChannels()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_2D;
}

Expand All @@ -684,7 +684,7 @@ const convParams_ExplicitPaddingDilatedType& convParams_ExplicitPadding_2D_dilat
::testing::ValuesIn(padEnds2d()),
::testing::Values(SizeVector{2, 2}),
::testing::ValuesIn(numOutChannels()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_2D_dilated;
}

Expand All @@ -696,7 +696,7 @@ const convParams_ExplicitPaddingType& convParams_ExplicitPadding_GEMM_3D() {
::testing::ValuesIn(padEnds3d()),
::testing::ValuesIn(dilations3d()),
::testing::ValuesIn(numOutChannels_Gemm()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_GEMM_3D;
}

Expand All @@ -708,7 +708,7 @@ const convParams_ExplicitPaddingDilatedType& convParams_ExplicitPadding_GEMM_3D_
::testing::ValuesIn(padEnds3d()),
::testing::Values(SizeVector{2, 2, 2}),
::testing::ValuesIn(numOutChannels_Gemm()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_GEMM_3D_dilated;
}

Expand All @@ -720,7 +720,7 @@ const convParams_ExplicitPaddingType& convParams_ExplicitPadding_3D() {
::testing::ValuesIn(padEnds3d()),
::testing::ValuesIn(dilations3d()),
::testing::ValuesIn(numOutChannels()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_3D;
}

Expand All @@ -732,7 +732,7 @@ const convParams_ExplicitPaddingDilatedType& convParams_ExplicitPadding_3D_dilat
::testing::ValuesIn(padEnds3d()),
::testing::Values(SizeVector{2, 2, 2}),
::testing::ValuesIn(numOutChannels()),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_3D_dilated;
}

Expand All @@ -744,7 +744,7 @@ const convParams_ExplicitPadding_1x1_Type& convParams_ExplicitPadding_1x1_1D() {
::testing::Values(std::vector<ptrdiff_t>({0})),
::testing::Values(SizeVector({1})),
::testing::Values(63),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_1x1_1D;
}

Expand All @@ -756,7 +756,7 @@ const convParams_ExplicitPadding_1x1_Type& convParams_ExplicitPadding_1x1_2D() {
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(SizeVector({1, 1})),
::testing::Values(63),
::testing::Values(ngraph::op::PadType::EXPLICIT));
::testing::Values(ov::op::PadType::EXPLICIT));
return convParams_ExplicitPadding_1x1_2D;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ class DeconvolutionLayerCPUTest : public testing::WithParamInterface<DeconvLayer
if (!outShapeData.empty()) {
if (outShapeType == ngraph::helpers::InputLayerType::PARAMETER) {
OPENVINO_ASSERT(inputDynamicShapes.size() == 2);
auto outShapeParam = std::make_shared<ngraph::opset8::Parameter>(ngraph::element::i32, inputDynamicShapes.back());
auto outShapeParam = std::make_shared<ov::op::v0::Parameter>(ngraph::element::i32, inputDynamicShapes.back());
params.push_back(outShapeParam);
outShapeNode = outShapeParam;
} else {
outShapeNode = ngraph::opset8::Constant::create(ngraph::element::i32, {outShapeData[inferRequestNum].size()}, outShapeData[inferRequestNum]);
outShapeNode = ov::op::v0::Constant::create(ngraph::element::i32, {outShapeData[inferRequestNum].size()}, outShapeData[inferRequestNum]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ class GroupConvolutionLayerCPUTest : public testing::WithParamInterface<groupCon
if (!opToShapeInfer) {
ngraph::OutputVector inputsForShapeInfer;
for (size_t j = 0; j < lastNode->get_input_size(); j++) {
if (ngraph::is_type<ngraph::opset1::Constant>(lastNode->get_input_node_ptr(j))) {
if (ngraph::is_type<ov::op::v0::Constant>(lastNode->get_input_node_ptr(j))) {
inputsForShapeInfer.push_back(lastNode->get_input_node_shared_ptr(j));
} else {
inputsForShapeInfer.push_back(std::make_shared<ngraph::opset1::Parameter>(lastNode->get_input_element_type(j),
inputsForShapeInfer.push_back(std::make_shared<ov::op::v0::Parameter>(lastNode->get_input_element_type(j),
lastNode->get_input_partial_shape(j)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ class GroupDeconvolutionLayerCPUTest : public testing::WithParamInterface<GroupD
if (!outShapeData.empty()) {
if (outShapeType == ngraph::helpers::InputLayerType::PARAMETER) {
OPENVINO_ASSERT(inputDynamicShapes.size() == 2);
auto outShapeParam = std::make_shared<ngraph::opset8::Parameter>(ngraph::element::i32, inputDynamicShapes.back());
auto outShapeParam = std::make_shared<ov::op::v0::Parameter>(ngraph::element::i32, inputDynamicShapes.back());
params.push_back(outShapeParam);
outShapeNode = outShapeParam;
} else {
outShapeNode = ngraph::opset8::Constant::create(ngraph::element::i32, {outShapeData[inferRequestNum].size()}, outShapeData[inferRequestNum]);
outShapeNode = ov::op::v0::Constant::create(ngraph::element::i32, {outShapeData[inferRequestNum].size()}, outShapeData[inferRequestNum]);
}
}

Expand Down
Loading
Loading