From 1926139b2be81a7d83fa4336094aaaa9a7b8db95 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 15:35:28 +0200 Subject: [PATCH 01/10] Use precise op version - Parameter --- .../op_reference/batch_to_space.cpp | 17 +++-- .../functional/op_reference/broadcast.cpp | 11 +-- .../tests/functional/op_reference/concat.cpp | 75 ++++++++++--------- .../op_reference/depth_to_space.cpp | 3 +- .../tests/functional/op_reference/einsum.cpp | 3 +- .../op_reference/extract_image_patches.cpp | 3 +- .../tests/functional/op_reference/gather.cpp | 13 ++-- .../functional/op_reference/gather_tree.cpp | 9 ++- .../tests/functional/op_reference/loop.cpp | 17 +++-- .../functional/op_reference/lstm_cell.cpp | 75 ++++++++++--------- .../functional/op_reference/matrix_nms.cpp | 5 +- .../functional/op_reference/nms_rotated.cpp | 15 ++-- .../op_reference/non_max_suppression.cpp | 59 ++++++++------- .../op_reference/random_uniform.cpp | 5 +- .../functional/op_reference/roi_align.cpp | 5 +- .../tests/functional/op_reference/roll.cpp | 3 +- .../op_reference/shuffle_channels.cpp | 3 +- .../tests/functional/op_reference/slice.cpp | 19 ++--- .../op_reference/space_to_batch.cpp | 9 ++- .../op_reference/space_to_depth.cpp | 3 +- .../op_reference/tensor_iterator.cpp | 13 ++-- .../tests/functional/op_reference/tile.cpp | 3 +- .../tests/functional/op_reference/topk.cpp | 35 ++++----- .../disable_transformations_test.cpp | 5 +- 24 files changed, 216 insertions(+), 192 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/batch_to_space.cpp b/src/plugins/template/tests/functional/op_reference/batch_to_space.cpp index 10583280efd619..96ac6fd261717f 100644 --- a/src/plugins/template/tests/functional/op_reference/batch_to_space.cpp +++ b/src/plugins/template/tests/functional/op_reference/batch_to_space.cpp @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/batch_to_space.hpp" + #include #include "base_reference_test.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset2.hpp" +#include "openvino/op/parameter.hpp" using namespace reference_tests; using namespace ov; @@ -47,7 +48,7 @@ class ReferenceBatchToSpaceLayerTest : public testing::TestWithParam& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; result << "dType=" << param.dataTensor.type; result << "_dShape=" << param.dataTensor.shape; @@ -69,11 +70,11 @@ class ReferenceBatchToSpaceLayerTest : public testing::TestWithParam CreateFunction(const BatchToSpaceParams& params) { - const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto blockShape = std::make_shared(element::i64, params.blockShapeTensor.shape); - const auto cropsBegin = std::make_shared(element::i64, params.cropsBeginTensor.shape); - const auto cropsEnd = std::make_shared(element::i64, params.cropsEndTensor.shape); - const auto batchToSpace = std::make_shared(data, blockShape, cropsBegin, cropsEnd); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto blockShape = std::make_shared(element::i64, params.blockShapeTensor.shape); + const auto cropsBegin = std::make_shared(element::i64, params.cropsBeginTensor.shape); + const auto cropsEnd = std::make_shared(element::i64, params.cropsEndTensor.shape); + const auto batchToSpace = std::make_shared(data, blockShape, cropsBegin, cropsEnd); return std::make_shared(NodeVector{batchToSpace}, ParameterVector{data, blockShape, cropsBegin, cropsEnd}); } diff --git a/src/plugins/template/tests/functional/op_reference/broadcast.cpp b/src/plugins/template/tests/functional/op_reference/broadcast.cpp index 5cb9712c8b2b2d..f7fa13c752482d 100644 --- a/src/plugins/template/tests/functional/op_reference/broadcast.cpp +++ b/src/plugins/template/tests/functional/op_reference/broadcast.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" @@ -56,7 +57,7 @@ class ReferenceBroadcastTest : public testing::TestWithParam, p private: static std::shared_ptr CreateFunction(const BroadcastParams& params) { - const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, opset1::Constant::create(params.targetShapeTensor.type, @@ -74,7 +75,7 @@ TEST_P(ReferenceBroadcastTest, CompareWithRefs) { class ReferenceBroadcastTestV3 : public ReferenceBroadcastTest { private: static std::shared_ptr CreateFunction(const BroadcastParams& params) { - const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, opset1::Constant::create(params.targetShapeTensor.type, @@ -132,7 +133,7 @@ class ReferenceBroadcastTestExplicitAxis : public testing::TestWithParam CreateFunction(const BroadcastParamsExplicitAxis& params) { - const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, opset1::Constant::create(params.targetShapeTensor.type, @@ -203,7 +204,7 @@ class ReferenceBroadcastTestTestHelper : public testing::TestWithParam CreateFunction(const BroadcastParamsTestHelper& params) { - const auto A = std::make_shared(element::f32, params.shapeA); + const auto A = std::make_shared(element::f32, params.shapeA); const auto shape_const = opset1::Constant::create(element::u64, Shape{params.shapeR.size()}, params.shapeR); std::shared_ptr broadcast; if (params.axes.size() > 0) { @@ -239,7 +240,7 @@ TEST_P(ReferenceBroadcastTestTestHelper, CompareWithRefs) { class ReferenceBroadcastTestExplicitAxisReversed : public ReferenceBroadcastTestExplicitAxis { private: static std::shared_ptr CreateFunction(const BroadcastParamsExplicitAxis& params) { - const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); auto broadcast = std::make_shared(A, opset1::Constant::create(params.targetShapeTensor.type, diff --git a/src/plugins/template/tests/functional/op_reference/concat.cpp b/src/plugins/template/tests/functional/op_reference/concat.cpp index b11a3d1e4a4658..1b654ffa33f60b 100644 --- a/src/plugins/template/tests/functional/op_reference/concat.cpp +++ b/src/plugins/template/tests/functional/op_reference/concat.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -68,15 +69,15 @@ class ReferenceConcatTest : public testing::TestWithParam, public private: static std::shared_ptr CreateFunction(const ConcatParams& params) { - std::shared_ptr A, B, C; + std::shared_ptr A, B, C; if (params.dynamicShape.is_dynamic()) { - A = std::make_shared(params.A.type, params.dynamicShape); - B = std::make_shared(params.B.type, params.dynamicShape); - C = std::make_shared(params.C.type, params.dynamicShape); + A = std::make_shared(params.A.type, params.dynamicShape); + B = std::make_shared(params.B.type, params.dynamicShape); + C = std::make_shared(params.C.type, params.dynamicShape); } else { - A = std::make_shared(params.A.type, params.A.shape); - B = std::make_shared(params.B.type, params.B.shape); - C = std::make_shared(params.C.type, params.C.shape); + A = std::make_shared(params.A.type, params.A.shape); + B = std::make_shared(params.B.type, params.B.shape); + C = std::make_shared(params.C.type, params.C.shape); } auto f = std::make_shared(std::make_shared(NodeVector{A, B, C}, params.axis), ParameterVector{A, B, C}); @@ -190,7 +191,7 @@ class ReferenceConcatTestVectorLarge : public testing::TestWithParam(element::f32, shape_a); + auto A = std::make_shared(element::f32, shape_a); inputs_param.push_back(A); inputs.push_back(A); } @@ -309,11 +310,11 @@ class ReferenceConcatTestInPlace2dTensor : public testing::TestWithParam CreateFunction(const ConcatParamsInPlace2dTensor& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); - const auto C = std::make_shared(params.C.type, params.C.shape); - const auto D = std::make_shared(params.D.type, params.D.shape); + const auto C = std::make_shared(params.C.type, params.C.shape); + const auto D = std::make_shared(params.D.type, params.D.shape); const auto add2 = std::make_shared(C, D); const auto subtract = std::make_shared(C, A); const auto f = @@ -426,11 +427,11 @@ class ReferenceConcatTestInPlacePropagate2dTensor : public testing::TestWithPara private: static std::shared_ptr CreateFunction(const ConcatParamsInPlacePropagate2dTensor& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); - const auto C = std::make_shared(params.C.type, params.C.shape); - const auto D = std::make_shared(params.D.type, params.D.shape); + const auto C = std::make_shared(params.C.type, params.C.shape); + const auto D = std::make_shared(params.D.type, params.D.shape); const auto add2 = std::make_shared(C, D); const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); const auto subtract = std::make_shared(C, A); @@ -534,8 +535,8 @@ class ReferenceConcatTestInPlaceTree1 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree1& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); const auto add2 = std::make_shared(A, B); const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); @@ -635,8 +636,8 @@ class ReferenceConcatTestInPlaceTree2 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree2& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); const auto add2 = std::make_shared(A, B); const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); @@ -740,8 +741,8 @@ class ReferenceConcatTestInPlaceTree3 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree3& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto concat1 = std::make_shared(NodeVector{A, B}, params.axis); const auto concat2 = std::make_shared(NodeVector{A, B}, params.axis); const auto concat3 = std::make_shared(NodeVector{A, B}, params.axis); @@ -848,8 +849,8 @@ class ReferenceConcatTestInPlaceAddConcat : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceAddConcat& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); const auto add2 = std::make_shared(add1, add1); const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); @@ -950,8 +951,8 @@ class ReferenceConcatTestInPlaceAddConcat2 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceAddConcat2& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto add1 = std::make_shared(A, B); const auto add2 = std::make_shared(A, B); const auto add3 = std::make_shared(A, B); @@ -1061,9 +1062,9 @@ class ReferenceConcatTest5d : public testing::TestWithParam, pub private: static std::shared_ptr CreateFunction(const ConcatParams5d& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); - const auto C = std::make_shared(params.C.type, params.C.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); + const auto C = std::make_shared(params.C.type, params.C.shape); const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; @@ -1210,8 +1211,8 @@ class ReferenceConcatTestZeroLength1dLast : public testing::TestWithParam CreateFunction(const ConcatParamsZeroLength1dLast& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto concat = std::make_shared(NodeVector{A, B}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B}); return f; @@ -1314,9 +1315,9 @@ class ReferenceConcatTestZeroLength1dMiddle : public testing::TestWithParam CreateFunction(const ConcatParamsZeroLength1dMiddle& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); - const auto C = std::make_shared(params.C.type, params.C.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); + const auto C = std::make_shared(params.C.type, params.C.shape); const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; @@ -1511,9 +1512,9 @@ class ReferenceConcatTestZeroLength4dMiddle : public testing::TestWithParam CreateFunction(const ConcatParamsZeroLength4dMiddle& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); - const auto C = std::make_shared(params.C.type, params.C.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); + const auto C = std::make_shared(params.C.type, params.C.shape); const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp b/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp index 6f683ed5452765..49beda3c56da59 100644 --- a/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp +++ b/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -59,7 +60,7 @@ class ReferenceDepthToSpaceLayerTest : public testing::TestWithParam(params.dataTensor.type, params.dataTensor.shape); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto depthToSpace = std::make_shared(data, mode, params.blockSize); return std::make_shared(NodeVector{depthToSpace}, ParameterVector{data}); } diff --git a/src/plugins/template/tests/functional/op_reference/einsum.cpp b/src/plugins/template/tests/functional/op_reference/einsum.cpp index 400fdc445c5387..128c0ca7c427a1 100644 --- a/src/plugins/template/tests/functional/op_reference/einsum.cpp +++ b/src/plugins/template/tests/functional/op_reference/einsum.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" @@ -56,7 +57,7 @@ class ReferenceEinsumTest : public testing::TestWithParam, public OutputVector output_vector; ParameterVector param_vector; for (const auto& input_tensor : params.inputs) { - auto param = std::make_shared(input_tensor.type, input_tensor.shape); + auto param = std::make_shared(input_tensor.type, input_tensor.shape); output_vector.push_back(param); param_vector.push_back(param); } diff --git a/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp b/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp index 62fc41dbea9b2c..8a2221f331be18 100644 --- a/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp +++ b/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" @@ -61,7 +62,7 @@ class ReferenceExtractImagePatchesTest : public testing::TestWithParam CreateModel(const ExtractImagePatchesParams& params) { - const auto data = std::make_shared(params.data.type, params.data.shape); + const auto data = std::make_shared(params.data.type, params.data.shape); const auto extrace_image_patches = std::make_shared(data, params.sizes, params.strides, diff --git a/src/plugins/template/tests/functional/op_reference/gather.cpp b/src/plugins/template/tests/functional/op_reference/gather.cpp index 916cee50407836..f4f588ab455483 100644 --- a/src/plugins/template/tests/functional/op_reference/gather.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" #include "openvino/opsets/opset8.hpp" @@ -62,8 +63,8 @@ class ReferenceGatherTest : public testing::TestWithParam, public private: static std::shared_ptr CreateFunction(const GatherParams& params) { - const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); + const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A); @@ -129,8 +130,8 @@ class ReferenceGatherTestV7 : public testing::TestWithParam, pub private: static std::shared_ptr CreateFunction(const GatherParamsV7& params) { - const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); + const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A, params.batchDims); @@ -146,8 +147,8 @@ TEST_P(ReferenceGatherTestV7, CompareWithRefs) { class ReferenceGatherTestV8 : public ReferenceGatherTestV7 { private: static std::shared_ptr CreateFunction(const GatherParamsV7& params) { - const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); + const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A, params.batchDims); diff --git a/src/plugins/template/tests/functional/op_reference/gather_tree.cpp b/src/plugins/template/tests/functional/op_reference/gather_tree.cpp index 696820760e8fea..65a97e8a151c07 100644 --- a/src/plugins/template/tests/functional/op_reference/gather_tree.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather_tree.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -59,10 +60,10 @@ class ReferenceGatherTreeTest : public testing::TestWithParam, private: static std::shared_ptr CreateFunction(const GatherTreeParams& params) { - const auto step_ids = std::make_shared(params.stepIds.type, params.stepIds.shape); - const auto parent_idx = std::make_shared(params.parentIdx.type, params.parentIdx.shape); - const auto max_seq_len = std::make_shared(params.maxSeqLen.type, params.maxSeqLen.shape); - const auto end_token = std::make_shared(params.endToken.type, params.endToken.shape); + const auto step_ids = std::make_shared(params.stepIds.type, params.stepIds.shape); + const auto parent_idx = std::make_shared(params.parentIdx.type, params.parentIdx.shape); + const auto max_seq_len = std::make_shared(params.maxSeqLen.type, params.maxSeqLen.shape); + const auto end_token = std::make_shared(params.endToken.type, params.endToken.shape); const auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); const auto f = std::make_shared(gather_tree, ParameterVector{step_ids, parent_idx, max_seq_len, end_token}); diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index 7ff49b7173f9ab..72c38c79b06db1 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -10,6 +10,7 @@ #include "base_reference_test.hpp" #include "common_test_utils/common_utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/parameter.hpp" namespace { enum LOOP_IN_TYPE { INVARIANT, MERGED }; @@ -30,15 +31,15 @@ struct LoopDynamicInputs : public LoopFunctionalBase { const int64_t& trip_count_value, const std::vector& loop_in_type, const ov::element::Type& net_type) override { - auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); // Set up the cell body, a function from (Xi, Yi) -> (Zo) // Body parameters - auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); @@ -131,7 +132,7 @@ struct LoopStaticInputs : public LoopFunctionalBase { const ov::element::Type& net_type) override { ov::ParameterVector loop_params; for (auto&& input : loop_inputs) { - loop_params.emplace_back(std::make_shared(input.type, input.shape)); + loop_params.emplace_back(std::make_shared(input.type, input.shape)); } // Set up the cell body, a function from (Xi, Yi) -> (Zo) @@ -139,7 +140,7 @@ struct LoopStaticInputs : public LoopFunctionalBase { const std::vector body_params_shapes(loop_inputs.size(), ov::PartialShape::dynamic()); ov::ParameterVector body_params; for (const auto& pshape : body_params_shapes) { - body_params.emplace_back(std::make_shared(net_type, pshape)); + body_params.emplace_back(std::make_shared(net_type, pshape)); } const auto body_condition_const = diff --git a/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp b/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp index 8df731e9f6f459..ac5e2e53e8cb84 100644 --- a/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp +++ b/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset4.hpp" @@ -84,12 +85,12 @@ class ReferenceLSTMCellTest : public testing::TestWithParam, pub private: static std::shared_ptr CreateFunction(const LSTMCellParams& params) { - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = std::make_shared(X, @@ -117,12 +118,12 @@ class ReferenceLSTMCellTestBiasDefaultAttrs : public ReferenceLSTMCellTest { private: static std::shared_ptr CreateFunction(const LSTMCellParams& params) { - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = std::make_shared(X, @@ -152,12 +153,12 @@ class ReferenceLSTMCellTestBiasClip : public ReferenceLSTMCellTest { static std::shared_ptr CreateFunction(const LSTMCellParams& params) { const float clip_threshold = 3.5f; - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = std::make_shared(X, H_t, @@ -191,12 +192,12 @@ TEST_P(ReferenceLSTMCellTestBiasClip, CompareWithRefs) { class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest { private: static std::shared_ptr CreateFunction(const LSTMCellParams& params) { - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = std::make_shared(X, @@ -215,12 +216,12 @@ class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest { class ReferenceLSTMCellV1TestBiasDefaultAttrs : public ReferenceLSTMCellTestBiasDefaultAttrs { private: static std::shared_ptr CreateFunction(const LSTMCellParams& params) { - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = std::make_shared(X, @@ -256,13 +257,13 @@ class ReferenceLSTMCellV1TestBiasClip : public ReferenceLSTMCellTestBiasClip { static std::shared_ptr CreateFunction(const LSTMCellParams& params) { const float clip_threshold = 3.5f; - const auto X = std::make_shared(params.X.type, params.X.shape); - const auto W = std::make_shared(params.W.type, params.W.shape); - const auto R = std::make_shared(params.R.type, params.R.shape); - const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); - const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); - const auto B = std::make_shared(params.B.type, params.B.shape); - const auto P = std::make_shared(params.P.type, params.P.shape); + const auto X = std::make_shared(params.X.type, params.X.shape); + const auto W = std::make_shared(params.W.type, params.W.shape); + const auto R = std::make_shared(params.R.type, params.R.shape); + const auto H_t = std::make_shared(params.H_t.type, params.H_t.shape); + const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); + const auto B = std::make_shared(params.B.type, params.B.shape); + const auto P = std::make_shared(params.P.type, params.P.shape); const auto lstm_cell = std::make_shared(X, H_t, diff --git a/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp b/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp index 4c2fd3ee50755c..244cac53544cb4 100644 --- a/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp +++ b/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset8.hpp" @@ -71,8 +72,8 @@ class ReferenceMatrixNmsTest : public testing::TestWithParam, p private: static std::shared_ptr CreateFunction(const MatrixNmsParams& params) { - const auto boxes = std::make_shared(params.boxes.type, PartialShape::dynamic()); - const auto scores = std::make_shared(params.scores.type, PartialShape::dynamic()); + const auto boxes = std::make_shared(params.boxes.type, PartialShape::dynamic()); + const auto scores = std::make_shared(params.scores.type, PartialShape::dynamic()); const auto nms = std::make_shared(boxes, scores, params.attrs); const auto f = std::make_shared(nms->outputs(), ParameterVector{boxes, scores}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp index d22aa82911830d..000f6c39d06b72 100644 --- a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp +++ b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset13.hpp" @@ -72,8 +73,8 @@ class ReferenceNMSRotatedTest : public testing::TestWithParam, private: static std::shared_ptr CreateModel(const NMSRotatedParams& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, @@ -113,15 +114,15 @@ class ReferenceNMSRotatedTestWithoutConstants : public ReferenceNMSRotatedTest { private: static std::shared_ptr CreateModel(const NMSRotatedParams& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape); const auto iou_threshold = - std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); + std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = - std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); + std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, diff --git a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp index 333ea4cf0d2845..e3c26af4b6472c 100644 --- a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp +++ b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" #include "openvino/opsets/opset4.hpp" @@ -75,8 +76,8 @@ class ReferenceNonMaxSuppressionTest : public testing::TestWithParam CreateFunction(const NonMaxSuppressionParams& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, @@ -122,17 +123,17 @@ class ReferenceNonMaxSuppressionTestWithoutConstants : public ReferenceNonMaxSup private: static std::shared_ptr CreateFunction(const NonMaxSuppressionParams& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape); const auto iou_threshold = - std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); + std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = - std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); + std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto soft_nms_sigma = - std::make_shared(params.softNmsSigma.type, params.softNmsSigma.shape); + std::make_shared(params.softNmsSigma.type, params.softNmsSigma.shape); const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, @@ -465,8 +466,8 @@ class ReferenceNonMaxSuppression4Test : public testing::TestWithParam CreateFunction(const NonMaxSuppression4Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, @@ -505,15 +506,15 @@ class ReferenceNonMaxSuppression4TestWithoutConstants : public ReferenceNonMaxSu private: static std::shared_ptr CreateFunction(const NonMaxSuppression4Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape); const auto iou_threshold = - std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); + std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = - std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); + std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, @@ -804,8 +805,8 @@ class ReferenceNonMaxSuppression3Test : public testing::TestWithParam CreateFunction(const NonMaxSuppression3Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, @@ -844,15 +845,15 @@ class ReferenceNonMaxSuppression3TestWithoutConstants : public ReferenceNonMaxSu private: static std::shared_ptr CreateFunction(const NonMaxSuppression3Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape); const auto iou_threshold = - std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); + std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = - std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); + std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, @@ -1124,8 +1125,8 @@ class ReferenceNonMaxSuppression1Test : public testing::TestWithParam CreateFunction(const NonMaxSuppression1Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, @@ -1163,15 +1164,15 @@ class ReferenceNonMaxSuppression1TestWithoutConstants : public ReferenceNonMaxSu private: static std::shared_ptr CreateFunction(const NonMaxSuppression1Params& params) { - const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); - const auto scores = std::make_shared(params.scores.type, params.scores.shape); + const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); + const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape); const auto iou_threshold = - std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); + std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = - std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); + std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, diff --git a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp index 9da97ef7c0b426..218dbdcd6254e5 100644 --- a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp +++ b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset8.hpp" using namespace ov; @@ -64,8 +65,8 @@ class ReferenceRandomUniformLayerTest : public testing::TestWithParam(min_val.type, min_val.shape); - const auto max_val_param = std::make_shared(max_val.type, max_val.shape); + const auto min_val_param = std::make_shared(min_val.type, min_val.shape); + const auto max_val_param = std::make_shared(max_val.type, max_val.shape); auto out_shape_ = std::make_shared(element::i64, Shape{out_shape.size()}, out_shape); return std::make_shared(NodeVector{std::make_shared(out_shape_, diff --git a/src/plugins/template/tests/functional/op_reference/roi_align.cpp b/src/plugins/template/tests/functional/op_reference/roi_align.cpp index ede8f75ace3c04..30ebcd343be29b 100644 --- a/src/plugins/template/tests/functional/op_reference/roi_align.cpp +++ b/src/plugins/template/tests/functional/op_reference/roi_align.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" #include "openvino/opsets/opset4.hpp" @@ -133,7 +134,7 @@ class ReferenceROIAlignTest : public testing::TestWithParam, pub private: static std::shared_ptr CreateFunction(const ROIAlignParams& params) { - const auto featureMap = std::make_shared(params.iType, params.pShape); + const auto featureMap = std::make_shared(params.iType, params.pShape); const auto coords = std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = @@ -185,7 +186,7 @@ class ReferenceROIAlignV9Test : public testing::TestWithParam, private: static std::shared_ptr CreateFunction(const ROIAlignV9Params& params) { - const auto featureMap = std::make_shared(params.iType, params.pShape); + const auto featureMap = std::make_shared(params.iType, params.pShape); const auto coords = std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = diff --git a/src/plugins/template/tests/functional/op_reference/roll.cpp b/src/plugins/template/tests/functional/op_reference/roll.cpp index b9d2b54f5debb0..4f1621eb27412a 100644 --- a/src/plugins/template/tests/functional/op_reference/roll.cpp +++ b/src/plugins/template/tests/functional/op_reference/roll.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" @@ -61,7 +62,7 @@ class ReferenceRollLayerTest : public testing::TestWithParam, public private: static std::shared_ptr CreateFunction(const RollParams& params) { - const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto shift = std::make_shared(params.shiftTensor.type, params.shiftTensor.shape, params.shiftTensor.data.data()); diff --git a/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp b/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp index 7b605e62680c73..8c73dbf25c265c 100644 --- a/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp +++ b/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -59,7 +60,7 @@ class ReferenceShuffleChannelsLayerTest : public testing::TestWithParam CreateFunction(const ShuffleChannelsParams& params) { - const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto function = std::make_shared(data, params.axis, params.group); return std::make_shared(NodeVector{function}, ParameterVector{data}); } diff --git a/src/plugins/template/tests/functional/op_reference/slice.cpp b/src/plugins/template/tests/functional/op_reference/slice.cpp index 2fa64b2dd458d6..0fec88e0f187c4 100644 --- a/src/plugins/template/tests/functional/op_reference/slice.cpp +++ b/src/plugins/template/tests/functional/op_reference/slice.cpp @@ -7,6 +7,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset8.hpp" using namespace ov; @@ -102,11 +103,11 @@ class ReferenceSliceLayerTest : public testing::TestWithParam, publ const reference_tests::Tensor& stop, const reference_tests::Tensor& step, const reference_tests::Tensor& axes) { - const auto data_param = std::make_shared(data.type, data.shape); - const auto start_param = std::make_shared(start.type, start.shape); - const auto stop_param = std::make_shared(stop.type, stop.shape); - const auto step_param = std::make_shared(step.type, step.shape); - const auto axes_param = std::make_shared(axes.type, axes.shape); + const auto data_param = std::make_shared(data.type, data.shape); + const auto start_param = std::make_shared(start.type, start.shape); + const auto stop_param = std::make_shared(stop.type, stop.shape); + const auto step_param = std::make_shared(step.type, step.shape); + const auto axes_param = std::make_shared(axes.type, axes.shape); const auto slice = std::make_shared(data_param, start_param, stop_param, step_param, axes_param); return std::make_shared(NodeVector{slice}, @@ -118,10 +119,10 @@ class ReferenceSliceLayerTest : public testing::TestWithParam, publ const reference_tests::Tensor& start, const reference_tests::Tensor& stop, const reference_tests::Tensor& step) { - const auto data_param = std::make_shared(data.type, data.shape); - const auto start_param = std::make_shared(start.type, start.shape); - const auto stop_param = std::make_shared(stop.type, stop.shape); - const auto step_param = std::make_shared(step.type, step.shape); + const auto data_param = std::make_shared(data.type, data.shape); + const auto start_param = std::make_shared(start.type, start.shape); + const auto stop_param = std::make_shared(stop.type, stop.shape); + const auto step_param = std::make_shared(step.type, step.shape); const auto slice = std::make_shared(data_param, start_param, stop_param, step_param); return std::make_shared(NodeVector{slice}, diff --git a/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp b/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp index 39cadfe89560df..40c60e3c766490 100644 --- a/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp +++ b/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp @@ -6,6 +6,7 @@ #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset2.hpp" @@ -70,10 +71,10 @@ class ReferenceSpaceToBatchLayerTest : public testing::TestWithParam CreateFunction(const SpaceToBatchParams& params) { - const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto blockShape = std::make_shared(element::i64, params.blockShapeTensor.shape); - const auto padsBegin = std::make_shared(element::i64, params.padsBeginTensor.shape); - const auto padsEnd = std::make_shared(element::i64, params.padsEndTensor.shape); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); + const auto blockShape = std::make_shared(element::i64, params.blockShapeTensor.shape); + const auto padsBegin = std::make_shared(element::i64, params.padsBeginTensor.shape); + const auto padsEnd = std::make_shared(element::i64, params.padsEndTensor.shape); const auto batchToSpace = std::make_shared(data, blockShape, padsBegin, padsEnd); return std::make_shared(NodeVector{batchToSpace}, ParameterVector{data, blockShape, padsBegin, padsEnd}); diff --git a/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp b/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp index 7420376f802af7..bcf90c0f31bb9e 100644 --- a/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp +++ b/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -59,7 +60,7 @@ class ReferenceSpaceToDepthLayerTest : public testing::TestWithParam(params.dataTensor.type, params.dataTensor.shape); + const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto SpaceToDepth = std::make_shared(data, mode, params.blockSize); return std::make_shared(NodeVector{SpaceToDepth}, ParameterVector{data}); } diff --git a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp index 5c53422b0dad64..f45b827ada7385 100644 --- a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp +++ b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp @@ -9,6 +9,7 @@ #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/parameter.hpp" namespace { struct TIFunctionalBase { @@ -23,15 +24,15 @@ struct TIFunctionalBase { struct TIDynamicInputs : public TIFunctionalBase { std::shared_ptr create_function(const std::vector& ti_inputs, const std::vector& results) override { - auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto X = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Y = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); // Set up the cell body, a function from (Xi, Yi) -> (Zo) // Body parameters - auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); + auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); diff --git a/src/plugins/template/tests/functional/op_reference/tile.cpp b/src/plugins/template/tests/functional/op_reference/tile.cpp index 2a99ee45b11cb4..927351ea9c6f02 100644 --- a/src/plugins/template/tests/functional/op_reference/tile.cpp +++ b/src/plugins/template/tests/functional/op_reference/tile.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" using namespace reference_tests; @@ -55,7 +56,7 @@ class ReferenceTileTest : public testing::TestWithParam, public Comm private: static std::shared_ptr CreateFunction(const TileParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto repeats = std::make_shared(params.repeats.type, params.repeats.shape, params.repeats.data.data()); const auto tile = std::make_shared(A, repeats); diff --git a/src/plugins/template/tests/functional/op_reference/topk.cpp b/src/plugins/template/tests/functional/op_reference/topk.cpp index f3fac57bd2acf1..8e022114cebb43 100644 --- a/src/plugins/template/tests/functional/op_reference/topk.cpp +++ b/src/plugins/template/tests/functional/op_reference/topk.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset11.hpp" #include "openvino/opsets/opset3.hpp" @@ -116,7 +117,7 @@ class ReferenceTopKTestResnet50 : public testing::TestWithParam CreateFunction(const TopKParamsResnet50& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(A, opset1::Constant::create(element::i64, {}, {5}), 1, @@ -247,7 +248,7 @@ class ReferenceTopKTestMaxMinSort : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); @@ -602,7 +603,7 @@ class ReferenceTopKTestBackend : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); @@ -674,7 +675,7 @@ class ReferenceTopKTest1dMaxMin : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); @@ -1190,7 +1191,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTestInt64 : public ReferenceTopKTest1dMaxMin { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); @@ -1258,7 +1259,7 @@ class ReferenceTopKTestSingleOutput : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); @@ -1318,14 +1319,14 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, ReferenceTopKTest::getTestCaseName); TEST(ReferenceTopKTestInvalid, topk_v1_invalid_strings) { - const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); + const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k = opset1::Constant::create(element::i64, Shape{}, {1}); EXPECT_THROW(opset1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); EXPECT_THROW(opset1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) { - const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); + const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2}); EXPECT_THROW(opset1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f}); @@ -1337,7 +1338,7 @@ TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) { class ReferenceTopKTestResnet50V3 : public ReferenceTopKTestResnet50 { private: static std::shared_ptr CreateFunction(const TopKParamsResnet50& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(A, opset1::Constant::create(element::i64, {}, {5}), 1, @@ -1371,7 +1372,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTestMaxMinSortV3 : public ReferenceTopKTestMaxMinSort { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); @@ -1391,7 +1392,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTestBackendV3 : public ReferenceTopKTestBackend { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); @@ -1411,7 +1412,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTest1dMaxMinV3 : public ReferenceTopKTest1dMaxMin { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); @@ -1431,7 +1432,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTestInt64V3 : public ReferenceTopKTestInt64 { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); @@ -1451,7 +1452,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, class ReferenceTopKTestSingleOutputV3 : public ReferenceTopKTestSingleOutput { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); @@ -1469,14 +1470,14 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, ReferenceTopKTestSingleOutputV3::getTestCaseName); TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_strings) { - const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); + const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k = opset1::Constant::create(element::i64, Shape{}, {1}); EXPECT_THROW(opset3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); EXPECT_THROW(opset3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_k) { - const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); + const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2}); EXPECT_THROW(opset3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f}); @@ -1502,7 +1503,7 @@ class ReferenceTopKv11StableTest : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { - const auto A = std::make_shared(params.A.type, params.A.shape); + const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = opset11::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto topk_stable = std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, true); diff --git a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp index 6ad9c5c024f18a..208668f995adae 100644 --- a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp +++ b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp @@ -11,20 +11,21 @@ #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" +#include "openvino/op/parameter.hpp" #include "openvino/opsets/opset11.hpp" #include "template/properties.hpp" TEST(DisableTransformationsTests, TestTemplatePluginProperty) { std::shared_ptr m(nullptr), m_ref(nullptr); { - auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); + auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); auto like = ov::opset11::Constant::create(ov::element::i32, ov::Shape{1}, {1}); auto cvtlike = std::make_shared(data, like); m = std::make_shared(ov::NodeVector{cvtlike}, ov::ParameterVector{data}); } { - auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); + auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); auto cvt = std::make_shared(data, ov::element::i32); m_ref = std::make_shared(ov::NodeVector{cvt}, ov::ParameterVector{data}); From f9c2c1986206709de4008e914dc50f23679e3bd1 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 15:58:22 +0200 Subject: [PATCH 02/10] Use precise op version - Constant --- .../op_reference/binary_convolution.cpp | 3 +- .../functional/op_reference/broadcast.cpp | 19 ++++---- .../tests/functional/op_reference/concat.cpp | 3 +- .../tests/functional/op_reference/gather.cpp | 7 +-- .../group_convolution_backprop.cpp | 3 +- .../tests/functional/op_reference/loop.cpp | 13 ++--- .../functional/op_reference/nms_rotated.cpp | 7 +-- .../op_reference/non_max_suppression.cpp | 27 ++++++----- .../op_reference/prior_box_clustered.cpp | 5 +- .../op_reference/random_uniform.cpp | 3 +- .../functional/op_reference/roi_align.cpp | 9 ++-- .../tests/functional/op_reference/roll.cpp | 5 +- .../op_reference/tensor_iterator.cpp | 27 ++++++----- .../tests/functional/op_reference/tile.cpp | 3 +- .../tests/functional/op_reference/topk.cpp | 47 ++++++++++--------- .../disable_transformations_test.cpp | 3 +- 16 files changed, 100 insertions(+), 84 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp b/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp index 1917163d832f4e..66cf759a43309d 100644 --- a/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp +++ b/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp @@ -7,6 +7,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/opsets/opset8.hpp" using namespace reference_tests; @@ -95,7 +96,7 @@ class ReferenceBinaryConvolutionLayerTest : public testing::TestWithParam& filterData) { const op::PadType auto_pad{op::PadType::EXPLICIT}; const auto in = std::make_shared(params.inType, params.inputShape); - auto filter = std::make_shared(ov::element::u1, params.filterShape, &filterData[0]); + auto filter = std::make_shared(ov::element::u1, params.filterShape, &filterData[0]); const auto BinaryConvolution = std::make_shared(in, filter, params.strides, diff --git a/src/plugins/template/tests/functional/op_reference/broadcast.cpp b/src/plugins/template/tests/functional/op_reference/broadcast.cpp index f7fa13c752482d..fe69fc535dab68 100644 --- a/src/plugins/template/tests/functional/op_reference/broadcast.cpp +++ b/src/plugins/template/tests/functional/op_reference/broadcast.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" @@ -60,7 +61,7 @@ class ReferenceBroadcastTest : public testing::TestWithParam, p const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, - opset1::Constant::create(params.targetShapeTensor.type, + op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data())), ParameterVector{A}); @@ -78,7 +79,7 @@ class ReferenceBroadcastTestV3 : public ReferenceBroadcastTest { const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, - opset1::Constant::create(params.targetShapeTensor.type, + op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data())), ParameterVector{A}); @@ -136,10 +137,10 @@ class ReferenceBroadcastTestExplicitAxis : public testing::TestWithParam(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( std::make_shared(A, - opset1::Constant::create(params.targetShapeTensor.type, + op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data()), - opset1::Constant::create(params.axesMappingTensor.type, + op::v0::Constant::create(params.axesMappingTensor.type, params.axesMappingTensor.shape, params.axesMappingTensor.data.data())), ParameterVector{A}); @@ -205,11 +206,11 @@ class ReferenceBroadcastTestTestHelper : public testing::TestWithParam CreateFunction(const BroadcastParamsTestHelper& params) { const auto A = std::make_shared(element::f32, params.shapeA); - const auto shape_const = opset1::Constant::create(element::u64, Shape{params.shapeR.size()}, params.shapeR); + const auto shape_const = op::v0::Constant::create(element::u64, Shape{params.shapeR.size()}, params.shapeR); std::shared_ptr broadcast; if (params.axes.size() > 0) { auto axes_const = - opset1::Constant::create(element::i64, Shape{params.axes.size()}, params.axes.to_vector()); + op::v0::Constant::create(element::i64, Shape{params.axes.size()}, params.axes.to_vector()); broadcast = std::make_shared(A, shape_const, axes_const); } else { broadcast = std::make_shared(A, shape_const); @@ -243,14 +244,14 @@ class ReferenceBroadcastTestExplicitAxisReversed : public ReferenceBroadcastTest const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); auto broadcast = std::make_shared(A, - opset1::Constant::create(params.targetShapeTensor.type, + op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data()), - opset1::Constant::create(params.axesMappingTensor.type, + op::v0::Constant::create(params.axesMappingTensor.type, params.axesMappingTensor.shape, params.axesMappingTensor.data.data())); auto reverse = std::make_shared(broadcast, - opset1::Constant::create(element::i64, {1}, {1}), + op::v0::Constant::create(element::i64, {1}, {1}), opset1::Reverse::Mode::INDEX); auto f = std::make_shared(NodeVector{reverse}, ParameterVector{A}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/concat.cpp b/src/plugins/template/tests/functional/op_reference/concat.cpp index 1b654ffa33f60b..bc50e07d42fbc4 100644 --- a/src/plugins/template/tests/functional/op_reference/concat.cpp +++ b/src/plugins/template/tests/functional/op_reference/concat.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" @@ -1410,7 +1411,7 @@ class ReferenceConcatTestZeroZero : public testing::TestWithParam CreateFunction(const ConcatParamsZeroZero& params) { - const auto constant_1 = std::make_shared(params.A.type, params.A.shape, params.A.data.data()); + const auto constant_1 = std::make_shared(params.A.type, params.A.shape, params.A.data.data()); const auto concat_1 = std::make_shared(NodeVector{constant_1, constant_1}, params.axis); const auto f = std::make_shared(concat_1, ParameterVector{}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/gather.cpp b/src/plugins/template/tests/functional/op_reference/gather.cpp index f4f588ab455483..b7a0242e8caff5 100644 --- a/src/plugins/template/tests/functional/op_reference/gather.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" @@ -66,7 +67,7 @@ class ReferenceGatherTest : public testing::TestWithParam, public const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = - opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); + op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; @@ -133,7 +134,7 @@ class ReferenceGatherTestV7 : public testing::TestWithParam, pub const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = - opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); + op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A, params.batchDims); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; @@ -150,7 +151,7 @@ class ReferenceGatherTestV8 : public ReferenceGatherTestV7 { const auto P = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = - opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); + op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); const auto G = std::make_shared(P, I, A, params.batchDims); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp index 6cc21eb9cb4f04..f1081bf95537ff 100644 --- a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp +++ b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/group_conv.hpp" #include "openvino/opsets/opset8.hpp" @@ -187,7 +188,7 @@ class ReferenceGroupConvolutionBackpropDataLayerOutShapeTest const auto in = std::make_shared(params.inType, params.inputShape); const auto filter = std::make_shared(params.inType, params.filterShape); - auto output_shape = std::make_shared(element::i64, + auto output_shape = std::make_shared(element::i64, params.constantOutputShape, params.constantOutputShapeData); const auto GroupConvolutionBackpropData = diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index 72c38c79b06db1..c5331fb3a92c22 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -10,6 +10,7 @@ #include "base_reference_test.hpp" #include "common_test_utils/common_utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" namespace { @@ -40,10 +41,10 @@ struct LoopDynamicInputs : public LoopFunctionalBase { auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); - auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); - auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); + auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body auto sum = std::make_shared(Xi, Yi); auto Zo = std::make_shared(sum, M_body); @@ -144,10 +145,10 @@ struct LoopStaticInputs : public LoopFunctionalBase { } const auto body_condition_const = - std::make_shared(ov::element::boolean, ov::Shape{1}, true); - const auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + std::make_shared(ov::element::boolean, ov::Shape{1}, true); + const auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); std::shared_ptr trip_count_input; - trip_count_input = std::make_shared(ov::element::i64, ov::Shape{1}, trip_count); + trip_count_input = std::make_shared(ov::element::i64, ov::Shape{1}, trip_count); // Body std::shared_ptr Zo = body_params[0]; diff --git a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp index 000f6c39d06b72..10960e262d0e13 100644 --- a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp +++ b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset13.hpp" @@ -76,13 +77,13 @@ class ReferenceNMSRotatedTest : public testing::TestWithParam, const auto boxes = std::make_shared(params.boxes.type, params.boxes.shape); const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, params.maxOutputBoxesPerClass.data.data()); - const auto iou_threshold = std::make_shared(params.iouThreshold.type, + const auto iou_threshold = std::make_shared(params.iouThreshold.type, params.iouThreshold.shape, params.iouThreshold.data.data()); - const auto score_threshold = std::make_shared(params.scoreThreshold.type, + const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); const auto nms = std::make_shared(boxes, diff --git a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp index e3c26af4b6472c..59a38f34fe05ca 100644 --- a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp +++ b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" @@ -79,16 +80,16 @@ class ReferenceNonMaxSuppressionTest : public testing::TestWithParam(params.boxes.type, params.boxes.shape); const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, params.maxOutputBoxesPerClass.data.data()); - const auto iou_threshold = std::make_shared(params.iouThreshold.type, + const auto iou_threshold = std::make_shared(params.iouThreshold.type, params.iouThreshold.shape, params.iouThreshold.data.data()); - const auto score_threshold = std::make_shared(params.scoreThreshold.type, + const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); - const auto soft_nms_sigma = std::make_shared(params.softNmsSigma.type, + const auto soft_nms_sigma = std::make_shared(params.softNmsSigma.type, params.softNmsSigma.shape, params.softNmsSigma.data.data()); const auto nms = std::make_shared(boxes, @@ -469,13 +470,13 @@ class ReferenceNonMaxSuppression4Test : public testing::TestWithParam(params.boxes.type, params.boxes.shape); const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, params.maxOutputBoxesPerClass.data.data()); - const auto iou_threshold = std::make_shared(params.iouThreshold.type, + const auto iou_threshold = std::make_shared(params.iouThreshold.type, params.iouThreshold.shape, params.iouThreshold.data.data()); - const auto score_threshold = std::make_shared(params.scoreThreshold.type, + const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); const auto nms = std::make_shared(boxes, @@ -808,13 +809,13 @@ class ReferenceNonMaxSuppression3Test : public testing::TestWithParam(params.boxes.type, params.boxes.shape); const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, params.maxOutputBoxesPerClass.data.data()); - const auto iou_threshold = std::make_shared(params.iouThreshold.type, + const auto iou_threshold = std::make_shared(params.iouThreshold.type, params.iouThreshold.shape, params.iouThreshold.data.data()); - const auto score_threshold = std::make_shared(params.scoreThreshold.type, + const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); const auto nms = std::make_shared(boxes, @@ -1128,13 +1129,13 @@ class ReferenceNonMaxSuppression1Test : public testing::TestWithParam(params.boxes.type, params.boxes.shape); const auto scores = std::make_shared(params.scores.type, params.scores.shape); const auto max_output_boxes_per_class = - std::make_shared(params.maxOutputBoxesPerClass.type, + std::make_shared(params.maxOutputBoxesPerClass.type, params.maxOutputBoxesPerClass.shape, params.maxOutputBoxesPerClass.data.data()); - const auto iou_threshold = std::make_shared(params.iouThreshold.type, + const auto iou_threshold = std::make_shared(params.iouThreshold.type, params.iouThreshold.shape, params.iouThreshold.data.data()); - const auto score_threshold = std::make_shared(params.scoreThreshold.type, + const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); const auto nms = std::make_shared(boxes, diff --git a/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp b/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp index 9097c3a2019f8b..a1332125d4e20e 100644 --- a/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp +++ b/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/prior_box.hpp" #include "openvino/opsets/opset1.hpp" @@ -76,9 +77,9 @@ class ReferencePriorBoxClusteredLayerTest : public testing::TestWithParam CreateFunction(const PriorBoxClusteredParams& params) { auto LS = - std::make_shared(params.inType, params.layerShapeShape, params.layerShapeData.data()); + std::make_shared(params.inType, params.layerShapeShape, params.layerShapeData.data()); auto IS = - std::make_shared(params.inType, params.imageShapeShape, params.imageShapeData.data()); + std::make_shared(params.inType, params.imageShapeShape, params.imageShapeData.data()); const auto PriorBoxClustered = std::make_shared(LS, IS, params.attrs); return std::make_shared(NodeVector{PriorBoxClustered}, ParameterVector{}); } diff --git a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp index 218dbdcd6254e5..ac32cb4a828e7f 100644 --- a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp +++ b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset8.hpp" @@ -67,7 +68,7 @@ class ReferenceRandomUniformLayerTest : public testing::TestWithParam(min_val.type, min_val.shape); const auto max_val_param = std::make_shared(max_val.type, max_val.shape); - auto out_shape_ = std::make_shared(element::i64, Shape{out_shape.size()}, out_shape); + auto out_shape_ = std::make_shared(element::i64, Shape{out_shape.size()}, out_shape); return std::make_shared(NodeVector{std::make_shared(out_shape_, min_val_param, diff --git a/src/plugins/template/tests/functional/op_reference/roi_align.cpp b/src/plugins/template/tests/functional/op_reference/roi_align.cpp index 30ebcd343be29b..3aba39c4b5582e 100644 --- a/src/plugins/template/tests/functional/op_reference/roi_align.cpp +++ b/src/plugins/template/tests/functional/op_reference/roi_align.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" @@ -136,9 +137,9 @@ class ReferenceROIAlignTest : public testing::TestWithParam, pub static std::shared_ptr CreateFunction(const ROIAlignParams& params) { const auto featureMap = std::make_shared(params.iType, params.pShape); const auto coords = - std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); + std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = - std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); + std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); const auto roi_align = std::make_shared(featureMap, coords, roisIdx, @@ -188,9 +189,9 @@ class ReferenceROIAlignV9Test : public testing::TestWithParam, static std::shared_ptr CreateFunction(const ROIAlignV9Params& params) { const auto featureMap = std::make_shared(params.iType, params.pShape); const auto coords = - std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); + std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = - std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); + std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); const auto pooling_mode = EnumNames::as_enum(params.poolingMode); const auto aligned_mode = EnumNames::as_enum(params.alignedMode); const auto roi_align = std::make_shared(featureMap, diff --git a/src/plugins/template/tests/functional/op_reference/roll.cpp b/src/plugins/template/tests/functional/op_reference/roll.cpp index 4f1621eb27412a..938e2e65387d95 100644 --- a/src/plugins/template/tests/functional/op_reference/roll.cpp +++ b/src/plugins/template/tests/functional/op_reference/roll.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" @@ -63,10 +64,10 @@ class ReferenceRollLayerTest : public testing::TestWithParam, public private: static std::shared_ptr CreateFunction(const RollParams& params) { const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto shift = std::make_shared(params.shiftTensor.type, + const auto shift = std::make_shared(params.shiftTensor.type, params.shiftTensor.shape, params.shiftTensor.data.data()); - const auto axes = std::make_shared(params.axesTensor.type, + const auto axes = std::make_shared(params.axesTensor.type, params.axesTensor.shape, params.axesTensor.data.data()); const auto roll = std::make_shared(data, shift, axes); diff --git a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp index f45b827ada7385..069cd56d875898 100644 --- a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp +++ b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp @@ -9,6 +9,7 @@ #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" namespace { @@ -33,10 +34,10 @@ struct TIDynamicInputs : public TIFunctionalBase { auto Xi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto Yi = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); auto M_body = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto body_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); - auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); - auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); + auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); + auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body auto sum = std::make_shared(Xi, Yi); auto Zo = std::make_shared(sum, M_body); @@ -265,7 +266,7 @@ struct TIStaticInputs : public TIStaticFunctionalBase { // 2. Set PortMap // 3. Create outer function auto axis = - std::make_shared(ov::element::i64, + std::make_shared(ov::element::i64, ov::Shape{1}, std::vector{static_cast(params.sequenceAxis)}); switch (params.body_type) { @@ -294,9 +295,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase { auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1], body_params[2]}; - auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); - auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); - auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); + auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); + auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); + auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); auto lstm_cell = std::make_shared(out_vector[0], out_vector[1], out_vector[2], @@ -361,9 +362,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase { auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1]}; - auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); - auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); - auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); + auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); + auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); + auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); auto gru_cell = std::make_shared(out_vector[0], out_vector[1], W, @@ -424,9 +425,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase { auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1]}; - auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); - auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); - auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); + auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); + auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); + auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); auto rnn_cell = std::make_shared(out_vector[0], out_vector[1], W, diff --git a/src/plugins/template/tests/functional/op_reference/tile.cpp b/src/plugins/template/tests/functional/op_reference/tile.cpp index 927351ea9c6f02..d59da515eda46b 100644 --- a/src/plugins/template/tests/functional/op_reference/tile.cpp +++ b/src/plugins/template/tests/functional/op_reference/tile.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" @@ -58,7 +59,7 @@ class ReferenceTileTest : public testing::TestWithParam, public Comm static std::shared_ptr CreateFunction(const TileParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto repeats = - std::make_shared(params.repeats.type, params.repeats.shape, params.repeats.data.data()); + std::make_shared(params.repeats.type, params.repeats.shape, params.repeats.data.data()); const auto tile = std::make_shared(A, repeats); const auto f = std::make_shared(NodeVector{tile}, ParameterVector{A}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/topk.cpp b/src/plugins/template/tests/functional/op_reference/topk.cpp index 8e022114cebb43..bf3b1edaabf4b0 100644 --- a/src/plugins/template/tests/functional/op_reference/topk.cpp +++ b/src/plugins/template/tests/functional/op_reference/topk.cpp @@ -5,6 +5,7 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset11.hpp" @@ -119,12 +120,12 @@ class ReferenceTopKTestResnet50 : public testing::TestWithParam CreateFunction(const TopKParamsResnet50& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(A, - opset1::Constant::create(element::i64, {}, {5}), + op::v0::Constant::create(element::i64, {}, {5}), 1, opset1::TopK::Mode::MAX, opset1::TopK::SortType::SORT_VALUES); const auto C = std::make_shared(A, - opset1::Constant::create(element::i64, {}, {1}), + op::v0::Constant::create(element::i64, {}, {1}), 1, opset1::TopK::Mode::MAX, opset1::TopK::SortType::SORT_VALUES); @@ -249,7 +250,7 @@ class ReferenceTopKTestMaxMinSort : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; @@ -604,7 +605,7 @@ class ReferenceTopKTestBackend : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; @@ -676,7 +677,7 @@ class ReferenceTopKTest1dMaxMin : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; @@ -1192,7 +1193,7 @@ class ReferenceTopKTestInt64 : public ReferenceTopKTest1dMaxMin { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; @@ -1260,7 +1261,7 @@ class ReferenceTopKTestSingleOutput : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); return f; @@ -1320,18 +1321,18 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, TEST(ReferenceTopKTestInvalid, topk_v1_invalid_strings) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); - const auto k = opset1::Constant::create(element::i64, Shape{}, {1}); + const auto k = op::v0::Constant::create(element::i64, Shape{}, {1}); EXPECT_THROW(opset1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); EXPECT_THROW(opset1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); - const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2}); + const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2}); EXPECT_THROW(opset1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); - const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f}); + const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f}); EXPECT_THROW(opset1::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); - const auto k_negative = opset1::Constant::create(element::i8, Shape{}, {-1}); + const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1}); EXPECT_THROW(opset1::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); } @@ -1340,12 +1341,12 @@ class ReferenceTopKTestResnet50V3 : public ReferenceTopKTestResnet50 { static std::shared_ptr CreateFunction(const TopKParamsResnet50& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(A, - opset1::Constant::create(element::i64, {}, {5}), + op::v0::Constant::create(element::i64, {}, {5}), 1, opset1::TopK::Mode::MAX, opset1::TopK::SortType::SORT_VALUES); const auto C = std::make_shared(A, - opset1::Constant::create(element::i64, {}, {1}), + op::v0::Constant::create(element::i64, {}, {1}), 1, opset1::TopK::Mode::MAX, opset1::TopK::SortType::SORT_VALUES); @@ -1373,7 +1374,7 @@ class ReferenceTopKTestMaxMinSortV3 : public ReferenceTopKTestMaxMinSort { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; @@ -1393,7 +1394,7 @@ class ReferenceTopKTestBackendV3 : public ReferenceTopKTestBackend { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; @@ -1413,7 +1414,7 @@ class ReferenceTopKTest1dMaxMinV3 : public ReferenceTopKTest1dMaxMin { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; @@ -1433,7 +1434,7 @@ class ReferenceTopKTestInt64V3 : public ReferenceTopKTestInt64 { private: static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; @@ -1453,7 +1454,7 @@ class ReferenceTopKTestSingleOutputV3 : public ReferenceTopKTestSingleOutput { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); return f; @@ -1471,18 +1472,18 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_strings) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); - const auto k = opset1::Constant::create(element::i64, Shape{}, {1}); + const auto k = op::v0::Constant::create(element::i64, Shape{}, {1}); EXPECT_THROW(opset3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); EXPECT_THROW(opset3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_k) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); - const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2}); + const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2}); EXPECT_THROW(opset3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); - const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f}); + const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f}); EXPECT_THROW(opset3::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); - const auto k_negative = opset1::Constant::create(element::i8, Shape{}, {-1}); + const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1}); EXPECT_THROW(opset3::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); } @@ -1504,7 +1505,7 @@ class ReferenceTopKv11StableTest : public ReferenceTopKTest { private: static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto k = opset11::Constant::create(params.k.type, params.k.shape, params.k.data.data()); + const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto topk_stable = std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, true); const auto topk_unstable = diff --git a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp index 208668f995adae..82fe2916737b09 100644 --- a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp +++ b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp @@ -11,6 +11,7 @@ #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" +#include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/opsets/opset11.hpp" #include "template/properties.hpp" @@ -19,7 +20,7 @@ TEST(DisableTransformationsTests, TestTemplatePluginProperty) { std::shared_ptr m(nullptr), m_ref(nullptr); { auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); - auto like = ov::opset11::Constant::create(ov::element::i32, ov::Shape{1}, {1}); + auto like = ov::op::v0::Constant::create(ov::element::i32, ov::Shape{1}, {1}); auto cvtlike = std::make_shared(data, like); m = std::make_shared(ov::NodeVector{cvtlike}, ov::ParameterVector{data}); From 09f9d71f83541c214f399e0bddf1bf281237ca7d Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 16:02:49 +0200 Subject: [PATCH 03/10] Use precise op version - Result --- .../tests/functional/op_reference/loop.cpp | 9 +++++---- .../functional/op_reference/tensor_iterator.cpp | 15 ++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index c5331fb3a92c22..50ec5c67019439 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -12,6 +12,7 @@ #include "functional_test_utils/skip_tests_config.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" namespace { enum LOOP_IN_TYPE { INVARIANT, MERGED }; @@ -61,7 +62,7 @@ struct LoopDynamicInputs : public LoopFunctionalBase { loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0}); // Output is last Zo - auto result = std::make_shared(loop->get_iter_value(Zo, -1)); + auto result = std::make_shared(loop->get_iter_value(Zo, -1)); return std::make_shared(ov::ResultVector{result}, ov::ParameterVector{X, Y, M}); } }; @@ -179,9 +180,9 @@ struct LoopStaticInputs : public LoopFunctionalBase { // start=0, stride=1, part_size=1, end=-1, axis=1 const auto out2 = loop->get_concatenated_slices(Zo, 0, 1, 1, -1, 1); - const auto result0 = std::make_shared(out0); - const auto result1 = std::make_shared(out1); - const auto result2 = std::make_shared(out2); + const auto result0 = std::make_shared(out0); + const auto result1 = std::make_shared(out1); + const auto result2 = std::make_shared(out2); const auto function = std::make_shared(ov::ResultVector{result0, result1, result2}, loop_params, "loop"); return function; diff --git a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp index 069cd56d875898..80f73b64f76301 100644 --- a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp +++ b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp @@ -11,6 +11,7 @@ #include "functional_test_utils/skip_tests_config.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" +#include "openvino/op/result.hpp" namespace { struct TIFunctionalBase { @@ -311,9 +312,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase { params.clip); auto unsqueeze = std::make_shared(lstm_cell->output(0), axis); - ov::ResultVector results{std::make_shared(unsqueeze), - std::make_shared(lstm_cell->output(0)), - std::make_shared(lstm_cell->output(1))}; + ov::ResultVector results{std::make_shared(unsqueeze), + std::make_shared(lstm_cell->output(0)), + std::make_shared(lstm_cell->output(1))}; auto body = std::make_shared(results, body_params, "lstm_cell"); tensor_iterator->set_function(body); @@ -378,8 +379,8 @@ struct TIStaticInputs : public TIStaticFunctionalBase { false); auto unsqueeze = std::make_shared(gru_cell->output(0), axis); - ov::ResultVector results{std::make_shared(gru_cell->output(0)), - std::make_shared(unsqueeze)}; + ov::ResultVector results{std::make_shared(gru_cell->output(0)), + std::make_shared(unsqueeze)}; auto body = std::make_shared(results, body_params, "gru_cell"); tensor_iterator->set_function(body); @@ -440,8 +441,8 @@ struct TIStaticInputs : public TIStaticFunctionalBase { params.clip); auto unsqueeze = std::make_shared(rnn_cell->output(0), axis); - ov::ResultVector results{std::make_shared(rnn_cell), - std::make_shared(unsqueeze)}; + ov::ResultVector results{std::make_shared(rnn_cell), + std::make_shared(unsqueeze)}; auto body = std::make_shared(results, body_params, "rnn_cell"); tensor_iterator->set_function(body); From da2536da6c5ae895edfb263da1f567cb7f823162 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 17:54:33 +0200 Subject: [PATCH 04/10] Use precise op version - Add, Concat, Subtract --- .../tests/functional/op_reference/concat.cpp | 97 ++++++++++--------- .../tests/functional/op_reference/loop.cpp | 5 +- .../op_reference/tensor_iterator.cpp | 3 +- 3 files changed, 55 insertions(+), 50 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/concat.cpp b/src/plugins/template/tests/functional/op_reference/concat.cpp index bc50e07d42fbc4..da3a141b160a18 100644 --- a/src/plugins/template/tests/functional/op_reference/concat.cpp +++ b/src/plugins/template/tests/functional/op_reference/concat.cpp @@ -2,12 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/concat.hpp" + #include #include "base_reference_test.hpp" +#include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" +#include "openvino/op/subtract.hpp" using namespace reference_tests; using namespace ov; @@ -80,7 +83,7 @@ class ReferenceConcatTest : public testing::TestWithParam, public B = std::make_shared(params.B.type, params.B.shape); C = std::make_shared(params.C.type, params.C.shape); } - auto f = std::make_shared(std::make_shared(NodeVector{A, B, C}, params.axis), + auto f = std::make_shared(std::make_shared(NodeVector{A, B, C}, params.axis), ParameterVector{A, B, C}); return f; } @@ -196,7 +199,7 @@ class ReferenceConcatTestVectorLarge : public testing::TestWithParam(std::make_shared(inputs, 0), inputs_param); + function = std::make_shared(std::make_shared(inputs, 0), inputs_param); std::vector ref_result; for (uint32_t i = 0; i < params.numInputs; i++) { @@ -313,13 +316,13 @@ class ReferenceConcatTestInPlace2dTensor : public testing::TestWithParam CreateFunction(const ConcatParamsInPlace2dTensor& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); + const auto add1 = std::make_shared(A, B); const auto C = std::make_shared(params.C.type, params.C.shape); const auto D = std::make_shared(params.D.type, params.D.shape); - const auto add2 = std::make_shared(C, D); - const auto subtract = std::make_shared(C, A); + const auto add2 = std::make_shared(C, D); + const auto subtract = std::make_shared(C, A); const auto f = - std::make_shared(std::make_shared(NodeVector{add1, add2, subtract}, params.axis), + std::make_shared(std::make_shared(NodeVector{add1, add2, subtract}, params.axis), ParameterVector{A, B, C, D}); return f; } @@ -430,14 +433,14 @@ class ReferenceConcatTestInPlacePropagate2dTensor : public testing::TestWithPara static std::shared_ptr CreateFunction(const ConcatParamsInPlacePropagate2dTensor& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); + const auto add1 = std::make_shared(A, B); const auto C = std::make_shared(params.C.type, params.C.shape); const auto D = std::make_shared(params.D.type, params.D.shape); - const auto add2 = std::make_shared(C, D); - const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); - const auto subtract = std::make_shared(C, A); + const auto add2 = std::make_shared(C, D); + const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); + const auto subtract = std::make_shared(C, A); const auto f = - std::make_shared(std::make_shared(NodeVector{concat1, subtract}, params.axis), + std::make_shared(std::make_shared(NodeVector{concat1, subtract}, params.axis), ParameterVector{A, B, C, D}); return f; } @@ -538,10 +541,10 @@ class ReferenceConcatTestInPlaceTree1 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree1& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); - const auto add2 = std::make_shared(A, B); - const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); - const auto f = std::make_shared(std::make_shared(concat, concat), ParameterVector{A, B}); + const auto add1 = std::make_shared(A, B); + const auto add2 = std::make_shared(A, B); + const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); + const auto f = std::make_shared(std::make_shared(concat, concat), ParameterVector{A, B}); return f; } }; @@ -639,13 +642,13 @@ class ReferenceConcatTestInPlaceTree2 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree2& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); - const auto add2 = std::make_shared(A, B); - const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); - const auto concat2 = std::make_shared(NodeVector{add1, add2}, params.axis); - const auto concat12 = std::make_shared(NodeVector{concat1, concat2}, params.axis); + const auto add1 = std::make_shared(A, B); + const auto add2 = std::make_shared(A, B); + const auto concat1 = std::make_shared(NodeVector{add1, add2}, params.axis); + const auto concat2 = std::make_shared(NodeVector{add1, add2}, params.axis); + const auto concat12 = std::make_shared(NodeVector{concat1, concat2}, params.axis); const auto f = - std::make_shared(std::make_shared(concat12, concat12), ParameterVector{A, B}); + std::make_shared(std::make_shared(concat12, concat12), ParameterVector{A, B}); return f; } }; @@ -744,15 +747,15 @@ class ReferenceConcatTestInPlaceTree3 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceTree3& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto concat1 = std::make_shared(NodeVector{A, B}, params.axis); - const auto concat2 = std::make_shared(NodeVector{A, B}, params.axis); - const auto concat3 = std::make_shared(NodeVector{A, B}, params.axis); - const auto concat4 = std::make_shared(NodeVector{A, B}, params.axis); - const auto concat12 = std::make_shared(NodeVector{concat1, concat2}, params.axis); - const auto concat34 = std::make_shared(NodeVector{concat3, concat4}, params.axis); - const auto concat14 = std::make_shared(NodeVector{concat12, concat34}, params.axis); + const auto concat1 = std::make_shared(NodeVector{A, B}, params.axis); + const auto concat2 = std::make_shared(NodeVector{A, B}, params.axis); + const auto concat3 = std::make_shared(NodeVector{A, B}, params.axis); + const auto concat4 = std::make_shared(NodeVector{A, B}, params.axis); + const auto concat12 = std::make_shared(NodeVector{concat1, concat2}, params.axis); + const auto concat34 = std::make_shared(NodeVector{concat3, concat4}, params.axis); + const auto concat14 = std::make_shared(NodeVector{concat12, concat34}, params.axis); const auto f = - std::make_shared(std::make_shared(concat14, concat14), ParameterVector{A, B}); + std::make_shared(std::make_shared(concat14, concat14), ParameterVector{A, B}); return f; } }; @@ -852,10 +855,10 @@ class ReferenceConcatTestInPlaceAddConcat : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceAddConcat& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); - const auto add2 = std::make_shared(add1, add1); - const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); - const auto add3 = std::make_shared(concat, concat); + const auto add1 = std::make_shared(A, B); + const auto add2 = std::make_shared(add1, add1); + const auto concat = std::make_shared(NodeVector{add1, add2}, params.axis); + const auto add3 = std::make_shared(concat, concat); const auto f = std::make_shared(add3, ParameterVector{A, B}); return f; } @@ -954,14 +957,14 @@ class ReferenceConcatTestInPlaceAddConcat2 : public testing::TestWithParam CreateFunction(const ConcatParamsInPlaceAddConcat2& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto add1 = std::make_shared(A, B); - const auto add2 = std::make_shared(A, B); - const auto add3 = std::make_shared(A, B); - const auto add4 = std::make_shared(A, B); - const auto add5 = std::make_shared(A, B); - const auto concat1 = std::make_shared(NodeVector{add1, add2, add3}, params.axis); - const auto concat2 = std::make_shared(NodeVector{add4, add2, add5}, params.axis); - const auto add6 = std::make_shared(concat1, concat2); + const auto add1 = std::make_shared(A, B); + const auto add2 = std::make_shared(A, B); + const auto add3 = std::make_shared(A, B); + const auto add4 = std::make_shared(A, B); + const auto add5 = std::make_shared(A, B); + const auto concat1 = std::make_shared(NodeVector{add1, add2, add3}, params.axis); + const auto concat2 = std::make_shared(NodeVector{add4, add2, add5}, params.axis); + const auto add6 = std::make_shared(concat1, concat2); const auto f = std::make_shared(add6, ParameterVector{A, B}); return f; } @@ -1066,7 +1069,7 @@ class ReferenceConcatTest5d : public testing::TestWithParam, pub const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); const auto C = std::make_shared(params.C.type, params.C.shape); - const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); + const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; } @@ -1214,7 +1217,7 @@ class ReferenceConcatTestZeroLength1dLast : public testing::TestWithParam CreateFunction(const ConcatParamsZeroLength1dLast& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto concat = std::make_shared(NodeVector{A, B}, params.axis); + const auto concat = std::make_shared(NodeVector{A, B}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B}); return f; } @@ -1319,7 +1322,7 @@ class ReferenceConcatTestZeroLength1dMiddle : public testing::TestWithParam(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); const auto C = std::make_shared(params.C.type, params.C.shape); - const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); + const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; } @@ -1412,7 +1415,7 @@ class ReferenceConcatTestZeroZero : public testing::TestWithParam CreateFunction(const ConcatParamsZeroZero& params) { const auto constant_1 = std::make_shared(params.A.type, params.A.shape, params.A.data.data()); - const auto concat_1 = std::make_shared(NodeVector{constant_1, constant_1}, params.axis); + const auto concat_1 = std::make_shared(NodeVector{constant_1, constant_1}, params.axis); const auto f = std::make_shared(concat_1, ParameterVector{}); return f; } @@ -1516,7 +1519,7 @@ class ReferenceConcatTestZeroLength4dMiddle : public testing::TestWithParam(params.A.type, params.A.shape); const auto B = std::make_shared(params.B.type, params.B.shape); const auto C = std::make_shared(params.C.type, params.C.shape); - const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); + const auto concat = std::make_shared(NodeVector{A, B, C}, params.axis); const auto f = std::make_shared(concat, ParameterVector{A, B, C}); return f; } diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index 50ec5c67019439..2fe7f1a8c03b70 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -10,6 +10,7 @@ #include "base_reference_test.hpp" #include "common_test_utils/common_utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/op/result.hpp" @@ -47,7 +48,7 @@ struct LoopDynamicInputs : public LoopFunctionalBase { auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body - auto sum = std::make_shared(Xi, Yi); + auto sum = std::make_shared(Xi, Yi); auto Zo = std::make_shared(sum, M_body); auto body = std::make_shared(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body}); @@ -154,7 +155,7 @@ struct LoopStaticInputs : public LoopFunctionalBase { // Body std::shared_ptr Zo = body_params[0]; for (size_t i = 1; i < body_params.size(); ++i) { - Zo = std::make_shared(body_params[i], Zo); + Zo = std::make_shared(body_params[i], Zo); } const auto body = std::make_shared(ov::OutputVector{body_condition_const, Zo}, body_params); diff --git a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp index 80f73b64f76301..44c7bbfb876c03 100644 --- a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp +++ b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp @@ -9,6 +9,7 @@ #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" #include "openvino/op/result.hpp" @@ -40,7 +41,7 @@ struct TIDynamicInputs : public TIFunctionalBase { auto trip_count = std::make_shared(ov::element::i64, ov::Shape{1}, 3); auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body - auto sum = std::make_shared(Xi, Yi); + auto sum = std::make_shared(Xi, Yi); auto Zo = std::make_shared(sum, M_body); auto body = std::make_shared(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body}); From 7662d9ad9bbde47a4e5f4364cb961a68587de020 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 18:01:55 +0200 Subject: [PATCH 05/10] Use precise op version - NMS --- .../functional/op_reference/matrix_nms.cpp | 66 +++++------ .../op_reference/non_max_suppression.cpp | 105 +++++++++--------- 2 files changed, 84 insertions(+), 87 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp b/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp index 244cac53544cb4..f0adb506f6fa21 100644 --- a/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp +++ b/src/plugins/template/tests/functional/op_reference/matrix_nms.cpp @@ -2,19 +2,19 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/matrix_nms.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset8.hpp" using namespace reference_tests; using namespace ov; namespace { struct MatrixNmsParams { - MatrixNmsParams(const opset8::MatrixNms::Attributes& attrs, + MatrixNmsParams(const op::v8::MatrixNms::Attributes& attrs, const reference_tests::Tensor& boxes, const reference_tests::Tensor& scores, const reference_tests::Tensor& expectedSelectedScores, @@ -29,7 +29,7 @@ struct MatrixNmsParams { expectedValidOutputs(expectedValidOutputs), testcaseName(testcaseName) {} - opset8::MatrixNms::Attributes attrs; + op::v8::MatrixNms::Attributes attrs; reference_tests::Tensor boxes; reference_tests::Tensor scores; reference_tests::Tensor expectedSelectedScores; @@ -74,7 +74,7 @@ class ReferenceMatrixNmsTest : public testing::TestWithParam, p static std::shared_ptr CreateFunction(const MatrixNmsParams& params) { const auto boxes = std::make_shared(params.boxes.type, PartialShape::dynamic()); const auto scores = std::make_shared(params.scores.type, PartialShape::dynamic()); - const auto nms = std::make_shared(boxes, scores, params.attrs); + const auto nms = std::make_shared(boxes, scores, params.attrs); const auto f = std::make_shared(nms->outputs(), ParameterVector{boxes, scores}); return f; } @@ -92,14 +92,14 @@ std::vector generateParams() { std::vector params{ MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k 0, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -136,14 +136,14 @@ std::vector generateParams() { "matrix_nms_output_type_i64"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k 0, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -180,14 +180,14 @@ std::vector generateParams() { "matrix_nms_output_type_i32"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k 0, // background_class - opset8::MatrixNms::DecayFunction::GAUSSIAN, // decay_function + op::v8::MatrixNms::DecayFunction::GAUSSIAN, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -224,14 +224,14 @@ std::vector generateParams() { "matrix_nms_gaussian"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k 0, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -259,14 +259,14 @@ std::vector generateParams() { "matrix_nms_two_batches_two_classes"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type true, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.5f, // post_threshold true, // normalized @@ -297,14 +297,14 @@ std::vector generateParams() { "matrix_nms_two_batches_two_classes_by_score_cross_batch"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::CLASSID, // sort_result_type + op::v8::MatrixNms::SortResultType::CLASSID, // sort_result_type true, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.5f, // post_threshold true, // normalized @@ -335,14 +335,14 @@ std::vector generateParams() { "matrix_nms_two_batches_two_classes_by_classid_cross_batch"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::CLASSID, // sort_result_type + op::v8::MatrixNms::SortResultType::CLASSID, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k 3, // keep_top_k 0, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -370,14 +370,14 @@ std::vector generateParams() { "matrix_nms_by_keep_top_k"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -401,14 +401,14 @@ std::vector generateParams() { "matrix_nms_background"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -443,14 +443,14 @@ std::vector generateParams() { "matrix_nms_flipped_coordinates"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.8f, // post_threshold true, // normalized @@ -469,14 +469,14 @@ std::vector generateParams() { "matrix_nms_post_threshold"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.3f, // post_threshold true, // normalized @@ -498,14 +498,14 @@ std::vector generateParams() { "matrix_nms_identical_boxes"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 2, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -524,14 +524,14 @@ std::vector generateParams() { "matrix_nms_nms_top_k"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 0.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized @@ -546,14 +546,14 @@ std::vector generateParams() { "matrix_nms_single_box"), MatrixNmsParams( { - opset8::MatrixNms::SortResultType::SCORE, // sort_result_type + op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type false, // sort_result_across_batch ET_IND, // output_type 2.0f, // score_threshold 3, // nms_top_k -1, // keep_top_k -1, // background_class - opset8::MatrixNms::DecayFunction::LINEAR, // decay_function + op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function 2.0f, // gaussian_sigma 0.0f, // post_threshold true, // normalized diff --git a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp index 59a38f34fe05ca..9e623162a7418b 100644 --- a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp +++ b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp @@ -7,10 +7,7 @@ #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset3.hpp" -#include "openvino/opsets/opset4.hpp" -#include "openvino/opsets/opset5.hpp" +#include "openvino/op/non_max_suppression.hpp" using namespace reference_tests; using namespace ov; @@ -23,7 +20,7 @@ struct NonMaxSuppressionParams { reference_tests::Tensor iouThreshold; reference_tests::Tensor scoreThreshold; reference_tests::Tensor softNmsSigma; - opset5::NonMaxSuppression::BoxEncodingType boxEncoding; + op::v5::NonMaxSuppression::BoxEncodingType boxEncoding; reference_tests::Tensor expectedSelectedIndices; reference_tests::Tensor expectedSelectedScores; reference_tests::Tensor expectedValidOutputs; @@ -92,7 +89,7 @@ class ReferenceNonMaxSuppressionTest : public testing::TestWithParam(params.softNmsSigma.type, params.softNmsSigma.shape, params.softNmsSigma.data.data()); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -135,7 +132,7 @@ class ReferenceNonMaxSuppressionTestWithoutConstants : public ReferenceNonMaxSup std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); const auto soft_nms_sigma = std::make_shared(params.softNmsSigma.type, params.softNmsSigma.shape); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -175,7 +172,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CENTER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CENTER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .expectedSelectedScores( @@ -192,7 +189,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .expectedSelectedScores( @@ -213,7 +210,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector{0.0, 0.0, 0.9})) .expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector{1})) @@ -228,7 +225,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .expectedSelectedScores( reference_tests::Tensor(ET_TH, {2, 3}, std::vector{0.0, 0.0, 0.95, 0.0, 0.0, 0.9})) @@ -242,7 +239,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector{0.0, 0.0, 0.9})) .expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector{1})) @@ -257,7 +254,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .expectedSelectedScores( @@ -274,7 +271,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .expectedSelectedScores( reference_tests::Tensor(ET_TH, {2, 3}, std::vector{0.0, 0.0, 0.95, 0.0, 0.0, 0.9})) @@ -296,7 +293,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0})) .expectedSelectedScores(reference_tests::Tensor( @@ -318,7 +315,7 @@ std::vector generateParams() { .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0})) .expectedSelectedScores(reference_tests::Tensor( @@ -365,7 +362,7 @@ std::vector generateParamsWithoutConstants() { .iouThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector{0.4f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector{0.2f})) .softNmsSigma(reference_tests::Tensor(ET_TH, {1}, std::vector{0.0f})) - .boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 3})) .expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector{0.0f, 0.0f, 0.95f})) .expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector{1})) @@ -424,7 +421,7 @@ struct NonMaxSuppression4Params { reference_tests::Tensor maxOutputBoxesPerClass; reference_tests::Tensor iouThreshold; reference_tests::Tensor scoreThreshold; - opset4::NonMaxSuppression::BoxEncodingType boxEncoding; + op::v4::NonMaxSuppression::BoxEncodingType boxEncoding; reference_tests::Tensor expectedSelectedIndices; std::string testcaseName; }; @@ -479,7 +476,7 @@ class ReferenceNonMaxSuppression4Test : public testing::TestWithParam(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -516,7 +513,7 @@ class ReferenceNonMaxSuppression4TestWithoutConstants : public ReferenceNonMaxSu std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -554,7 +551,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CENTER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CENTER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_center_point_box_format"), @@ -567,7 +564,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_flipped_coordinates"), @@ -584,7 +581,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_identical_boxes"), @@ -596,7 +593,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_limit_output_size"), @@ -606,7 +603,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_single_box"), @@ -618,7 +615,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_suppress_by_IOU"), @@ -631,7 +628,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"), @@ -649,7 +646,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0})) .testcaseName("nonmaxsuppression_two_batches"), @@ -665,7 +662,7 @@ std::vector generateParams4() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0})) .testcaseName("nonmaxsuppression_two_classes"), @@ -706,7 +703,7 @@ std::vector generateParams4WithoutConstants() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.2f})) - .boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 3})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"), }; @@ -763,7 +760,7 @@ struct NonMaxSuppression3Params { reference_tests::Tensor maxOutputBoxesPerClass; reference_tests::Tensor iouThreshold; reference_tests::Tensor scoreThreshold; - opset3::NonMaxSuppression::BoxEncodingType boxEncoding; + op::v3::NonMaxSuppression::BoxEncodingType boxEncoding; reference_tests::Tensor expectedSelectedIndices; std::string testcaseName; }; @@ -818,7 +815,7 @@ class ReferenceNonMaxSuppression3Test : public testing::TestWithParam(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -855,7 +852,7 @@ class ReferenceNonMaxSuppression3TestWithoutConstants : public ReferenceNonMaxSu std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -893,7 +890,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CENTER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CENTER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_center_point_box_format"), @@ -906,7 +903,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_flipped_coordinates"), @@ -923,7 +920,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_identical_boxes"), @@ -935,7 +932,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_limit_output_size"), @@ -945,7 +942,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_single_box"), @@ -957,7 +954,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_suppress_by_IOU"), @@ -970,7 +967,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"), @@ -985,7 +982,7 @@ std::vector generateParams3() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0})) .testcaseName("nonmaxsuppression_two_classes"), @@ -1026,7 +1023,7 @@ std::vector generateParams3WithoutConstants() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.2f})) - .boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 3})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"), }; @@ -1083,7 +1080,7 @@ struct NonMaxSuppression1Params { reference_tests::Tensor maxOutputBoxesPerClass; reference_tests::Tensor iouThreshold; reference_tests::Tensor scoreThreshold; - opset1::NonMaxSuppression::BoxEncodingType boxEncoding; + op::v1::NonMaxSuppression::BoxEncodingType boxEncoding; reference_tests::Tensor expectedSelectedIndices; std::string testcaseName; }; @@ -1138,7 +1135,7 @@ class ReferenceNonMaxSuppression1Test : public testing::TestWithParam(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -1174,7 +1171,7 @@ class ReferenceNonMaxSuppression1TestWithoutConstants : public ReferenceNonMaxSu std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -1211,7 +1208,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CENTER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CENTER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_center_point_box_format"), @@ -1224,7 +1221,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_flipped_coordinates"), @@ -1241,7 +1238,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_identical_boxes"), @@ -1253,7 +1250,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_limit_output_size"), @@ -1263,7 +1260,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 0})) .testcaseName("nonmaxsuppression_single_box"), @@ -1275,7 +1272,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{3})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {3, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 0, 5})) .testcaseName("nonmaxsuppression_suppress_by_IOU"), @@ -1288,7 +1285,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector{0, 0, 3, 0, 0, 0})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"), @@ -1303,7 +1300,7 @@ std::vector generateParams1() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{2})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.5f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.0f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices( reference_tests::Tensor(ET_IND, {4, 3}, std::vector{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0})) .testcaseName("nonmaxsuppression_two_classes"), @@ -1341,7 +1338,7 @@ std::vector generateParams1WithoutConstants() { .maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector{1})) .iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.4f})) .scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector{0.2f})) - .boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER) + .boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER) .expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector{0, 0, 3})) .testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"), }; From 0dbc903c690b90e6f5e67134ebeba7c929065bf6 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 18:12:52 +0200 Subject: [PATCH 06/10] Use precise op version - TopK, Broadcast --- .../functional/op_reference/broadcast.cpp | 21 +- .../functional/op_reference/nms_rotated.cpp | 8 +- .../tests/functional/op_reference/topk.cpp | 304 +++++++++--------- 3 files changed, 166 insertions(+), 167 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/broadcast.cpp b/src/plugins/template/tests/functional/op_reference/broadcast.cpp index fe69fc535dab68..415116a39af6cf 100644 --- a/src/plugins/template/tests/functional/op_reference/broadcast.cpp +++ b/src/plugins/template/tests/functional/op_reference/broadcast.cpp @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/broadcast.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset3.hpp" +#include "openvino/op/reverse.hpp" using namespace reference_tests; using namespace ov; @@ -60,7 +61,7 @@ class ReferenceBroadcastTest : public testing::TestWithParam, p static std::shared_ptr CreateFunction(const BroadcastParams& params) { const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( - std::make_shared(A, + std::make_shared(A, op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data())), @@ -78,7 +79,7 @@ class ReferenceBroadcastTestV3 : public ReferenceBroadcastTest { static std::shared_ptr CreateFunction(const BroadcastParams& params) { const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( - std::make_shared(A, + std::make_shared(A, op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data())), @@ -136,7 +137,7 @@ class ReferenceBroadcastTestExplicitAxis : public testing::TestWithParam CreateFunction(const BroadcastParamsExplicitAxis& params) { const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); const auto f = std::make_shared( - std::make_shared(A, + std::make_shared(A, op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data()), @@ -211,9 +212,9 @@ class ReferenceBroadcastTestTestHelper : public testing::TestWithParam 0) { auto axes_const = op::v0::Constant::create(element::i64, Shape{params.axes.size()}, params.axes.to_vector()); - broadcast = std::make_shared(A, shape_const, axes_const); + broadcast = std::make_shared(A, shape_const, axes_const); } else { - broadcast = std::make_shared(A, shape_const); + broadcast = std::make_shared(A, shape_const); } auto f = std::make_shared(broadcast, ParameterVector{A}); return f; @@ -243,16 +244,16 @@ class ReferenceBroadcastTestExplicitAxisReversed : public ReferenceBroadcastTest static std::shared_ptr CreateFunction(const BroadcastParamsExplicitAxis& params) { const auto A = std::make_shared(params.dataTensor.type, params.dataTensor.shape); auto broadcast = - std::make_shared(A, + std::make_shared(A, op::v0::Constant::create(params.targetShapeTensor.type, params.targetShapeTensor.shape, params.targetShapeTensor.data.data()), op::v0::Constant::create(params.axesMappingTensor.type, params.axesMappingTensor.shape, params.axesMappingTensor.data.data())); - auto reverse = std::make_shared(broadcast, + auto reverse = std::make_shared(broadcast, op::v0::Constant::create(element::i64, {1}, {1}), - opset1::Reverse::Mode::INDEX); + op::v1::Reverse::Mode::INDEX); auto f = std::make_shared(NodeVector{reverse}, ParameterVector{A}); return f; } diff --git a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp index 10960e262d0e13..34f0bc074ec2f1 100644 --- a/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp +++ b/src/plugins/template/tests/functional/op_reference/nms_rotated.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/nms_rotated.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset13.hpp" using namespace reference_tests; using namespace ov; @@ -86,7 +86,7 @@ class ReferenceNMSRotatedTest : public testing::TestWithParam, const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape, params.scoreThreshold.data.data()); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, @@ -124,7 +124,7 @@ class ReferenceNMSRotatedTestWithoutConstants : public ReferenceNMSRotatedTest { std::make_shared(params.iouThreshold.type, params.iouThreshold.shape); const auto score_threshold = std::make_shared(params.scoreThreshold.type, params.scoreThreshold.shape); - const auto nms = std::make_shared(boxes, + const auto nms = std::make_shared(boxes, scores, max_output_boxes_per_class, iou_threshold, diff --git a/src/plugins/template/tests/functional/op_reference/topk.cpp b/src/plugins/template/tests/functional/op_reference/topk.cpp index bf3b1edaabf4b0..45e50eced49679 100644 --- a/src/plugins/template/tests/functional/op_reference/topk.cpp +++ b/src/plugins/template/tests/functional/op_reference/topk.cpp @@ -7,9 +7,7 @@ #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset11.hpp" -#include "openvino/opsets/opset3.hpp" +#include "openvino/op/topk.hpp" using namespace reference_tests; using namespace ov; @@ -19,8 +17,8 @@ struct TopKParams { TopKParams(const reference_tests::Tensor& A, const reference_tests::Tensor& k, const int64_t axis, - const opset1::TopK::Mode mode, - const opset1::TopK::SortType sort, + const op::v1::TopK::Mode mode, + const op::v1::TopK::SortType sort, const reference_tests::Tensor& result0, const reference_tests::Tensor& result1, const size_t outIdx, @@ -38,8 +36,8 @@ struct TopKParams { reference_tests::Tensor A; reference_tests::Tensor k; int64_t axis; - opset1::TopK::Mode mode; - opset1::TopK::SortType sort; + op::v1::TopK::Mode mode; + op::v1::TopK::SortType sort; reference_tests::Tensor result0; reference_tests::Tensor result1; size_t outIdx; @@ -119,16 +117,16 @@ class ReferenceTopKTestResnet50 : public testing::TestWithParam CreateFunction(const TopKParamsResnet50& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(A, + const auto B = std::make_shared(A, op::v0::Constant::create(element::i64, {}, {5}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES); - const auto C = std::make_shared(A, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES); + const auto C = std::make_shared(A, op::v0::Constant::create(element::i64, {}, {1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES); + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES); const auto out5_value = B->output(0); const auto out5_index = B->output(1); @@ -251,7 +249,7 @@ class ReferenceTopKTestMaxMinSort : public ReferenceTopKTest { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; } @@ -281,8 +279,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::NONE, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::NONE, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape, std::vector shape) -> std::vector { @@ -325,8 +323,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::NONE, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::NONE, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape) -> std::vector { @@ -370,8 +368,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape, std::vector shape) -> std::vector { @@ -410,8 +408,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape) -> std::vector { @@ -451,8 +449,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_INDICES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_INDICES, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape, std::vector shape) -> std::vector { @@ -495,8 +493,8 @@ std::vector generateParamsMaxMinSort() { }({128, 1000})), reference_tests::Tensor(ET2, {}, std::vector{5}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_INDICES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_INDICES, reference_tests::Tensor(ET, {128, 5}, [](std::vector rshape) -> std::vector { @@ -525,8 +523,8 @@ std::vector generateParamsMaxMinSort() { TopKParams(reference_tests::Tensor(ET, {5}, std::vector{3, 1, 2, 5, 4}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{5, 4, 3}), reference_tests::Tensor(ET_OUT, {3}, std::vector{3, 4, 0}), 0, @@ -535,8 +533,8 @@ std::vector generateParamsMaxMinSort() { TopKParams(reference_tests::Tensor(ET, {5}, std::vector{3, 1, 2, 5, 4}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_INDICES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_INDICES, reference_tests::Tensor(ET, {3}, std::vector{3, 5, 4}), reference_tests::Tensor(ET_OUT, {3}, std::vector{0, 3, 4}), 0, @@ -545,8 +543,8 @@ std::vector generateParamsMaxMinSort() { TopKParams(reference_tests::Tensor(ET, {5}, std::vector{3, 1, 2, 5, 4}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{1, 2, 3}), reference_tests::Tensor(ET_OUT, {3}, std::vector{1, 2, 0}), 0, @@ -555,8 +553,8 @@ std::vector generateParamsMaxMinSort() { TopKParams(reference_tests::Tensor(ET, {5}, std::vector{3, 1, 2, 5, 4}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_INDICES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_INDICES, reference_tests::Tensor(ET, {3}, std::vector{3, 1, 2}), reference_tests::Tensor(ET_OUT, {3}, std::vector{0, 1, 2}), 0, @@ -606,7 +604,7 @@ class ReferenceTopKTestBackend : public ReferenceTopKTest { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; } @@ -678,7 +676,7 @@ class ReferenceTopKTest1dMaxMin : public ReferenceTopKTest { static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; } @@ -697,8 +695,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{6}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET_OUT, {6}, std::vector{5, 4, 3, 2, 1, 0}), 0, @@ -707,8 +705,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{6}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET_OUT, {6}, std::vector{5, 4, 3, 2, 1, 0}), 1, @@ -717,8 +715,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{6, 5, 4}), reference_tests::Tensor(ET_OUT, {3}, std::vector{5, 4, 3}), 0, @@ -727,8 +725,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{6, 5, 4}), reference_tests::Tensor(ET_OUT, {3}, std::vector{5, 4, 3}), 1, @@ -737,8 +735,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1}, std::vector{6}), reference_tests::Tensor(ET_OUT, {1}, std::vector{5}), 0, @@ -747,8 +745,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1}, std::vector{6}), reference_tests::Tensor(ET_OUT, {1}, std::vector{5}), 1, @@ -757,8 +755,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{6}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET_OUT, {6}, std::vector{5, 4, 3, 2, 1, 0}), 0, @@ -767,8 +765,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{6}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {6}, std::vector{1, 2, 3, 4, 5, 6}), reference_tests::Tensor(ET_OUT, {6}, std::vector{5, 4, 3, 2, 1, 0}), 1, @@ -777,8 +775,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{1, 2, 3}), reference_tests::Tensor(ET_OUT, {3}, std::vector{5, 4, 3}), 0, @@ -787,8 +785,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{3}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {3}, std::vector{1, 2, 3}), reference_tests::Tensor(ET_OUT, {3}, std::vector{5, 4, 3}), 1, @@ -797,8 +795,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1}, std::vector{1}), reference_tests::Tensor(ET_OUT, {1}, std::vector{5}), 0, @@ -807,8 +805,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {6}, std::vector{6, 5, 4, 3, 2, 1}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1}, std::vector{1}), reference_tests::Tensor(ET_OUT, {1}, std::vector{5}), 1, @@ -817,8 +815,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}), 0, @@ -827,8 +825,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}), 1, @@ -856,8 +854,8 @@ std::vector generateParams1dMaxMin() { 215, 287, 200, 272, 208, 280, 216, 288}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor( ET, {2, 2, 3, 2, 4}, @@ -899,8 +897,8 @@ std::vector generateParams1dMaxMin() { 215, 287, 200, 272, 208, 280, 216, 288}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor( ET, {2, 2, 3, 2, 4}, @@ -923,8 +921,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 2}, std::vector{10, 12, 9, 4, 11, 7, 6, 3}), reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector{1, 1, 0, 2, 2, 2, 0, 1}), 0, @@ -933,8 +931,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 2}, std::vector{10, 12, 9, 4, 11, 7, 6, 3}), reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector{1, 1, 0, 2, 2, 2, 0, 1}), 1, @@ -943,8 +941,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1, 2}, std::vector{10, 12, 11, 7}), reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector{1, 1, 2, 2}), 0, @@ -953,8 +951,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1, 2}, std::vector{10, 12, 11, 7}), reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector{1, 1, 2, 2}), 1, @@ -963,8 +961,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}), 0, @@ -973,8 +971,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}), 1, @@ -983,8 +981,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 2}, std::vector{8, 2, 10, 4, 5, 1, 6, 3}), reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector{2, 0, 1, 2, 1, 0, 0, 1}), 0, @@ -993,8 +991,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 2}, std::vector{8, 2, 10, 4, 5, 1, 6, 3}), reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector{2, 0, 1, 2, 1, 0, 0, 1}), 1, @@ -1003,8 +1001,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1, 2}, std::vector{8, 2, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector{2, 0, 1, 0}), 0, @@ -1013,8 +1011,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1, 2}, std::vector{8, 2, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector{2, 0, 1, 0}), 1, @@ -1023,8 +1021,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{4}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {4, 3}, std::vector{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}), reference_tests::Tensor(ET_OUT, {4, 3}, std::vector{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}), 0, @@ -1033,8 +1031,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{4}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {4, 3}, std::vector{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}), reference_tests::Tensor(ET_OUT, {4, 3}, std::vector{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}), 1, @@ -1043,8 +1041,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3}, std::vector{12, 11, 10, 9, 8, 7}), reference_tests::Tensor(ET_OUT, {2, 3}, std::vector{1, 3, 0, 0, 1, 3}), 0, @@ -1053,8 +1051,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3}, std::vector{12, 11, 10, 9, 8, 7}), reference_tests::Tensor(ET_OUT, {2, 3}, std::vector{1, 3, 0, 0, 1, 3}), 1, @@ -1063,8 +1061,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1, 3}, std::vector{12, 11, 10}), reference_tests::Tensor(ET_OUT, {1, 3}, std::vector{1, 3, 0}), 0, @@ -1073,8 +1071,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {1, 3}, std::vector{12, 11, 10}), reference_tests::Tensor(ET_OUT, {1, 3}, std::vector{1, 3, 0}), 1, @@ -1083,8 +1081,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector{1, 3, 2, 4, 1, 3, 3, 2}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1}, std::vector{4, 3}), reference_tests::Tensor(ET_OUT, {2, 1}, std::vector{3, 1}), 0, @@ -1093,8 +1091,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector{1, 3, 2, 4, 1, 3, 3, 2}), reference_tests::Tensor(ET2, {}, std::vector{1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 1}, std::vector{4, 3}), reference_tests::Tensor(ET_OUT, {2, 1}, std::vector{3, 1}), 1, @@ -1103,8 +1101,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{4}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {4, 3}, std::vector{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}), reference_tests::Tensor(ET_OUT, {4, 3}, std::vector{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}), 0, @@ -1113,8 +1111,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{4}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {4, 3}, std::vector{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}), reference_tests::Tensor(ET_OUT, {4, 3}, std::vector{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}), 1, @@ -1123,8 +1121,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3}, std::vector{3, 1, 4, 6, 2, 5}), reference_tests::Tensor(ET_OUT, {2, 3}, std::vector{3, 2, 1, 2, 0, 2}), 0, @@ -1133,8 +1131,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3}, std::vector{3, 1, 4, 6, 2, 5}), reference_tests::Tensor(ET_OUT, {2, 3}, std::vector{3, 2, 1, 2, 0, 2}), 1, @@ -1143,8 +1141,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::NONE, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::NONE, reference_tests::Tensor(ET, {1, 3}, std::vector{3, 1, 4}), reference_tests::Tensor(ET_OUT, {1, 3}, std::vector{3, 2, 1}), 0, @@ -1153,8 +1151,8 @@ std::vector generateParams1dMaxMin() { TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{1}), 0, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::NONE, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::NONE, reference_tests::Tensor(ET, {1, 3}, std::vector{3, 1, 4}), reference_tests::Tensor(ET_OUT, {1, 3}, std::vector{3, 2, 1}), 1, @@ -1194,7 +1192,7 @@ class ReferenceTopKTestInt64 : public ReferenceTopKTest1dMaxMin { static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; } @@ -1213,8 +1211,8 @@ std::vector generateParamsInt64() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}), 0, @@ -1222,8 +1220,8 @@ std::vector generateParamsInt64() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3, 2}, std::vector{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}), reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}), 1, @@ -1262,7 +1260,7 @@ class ReferenceTopKTestSingleOutput : public ReferenceTopKTest { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); return f; } @@ -1281,8 +1279,8 @@ std::vector generateParamsSingleOutput() { TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 2}, std::vector{}), reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector{2, 0, 1, 2, 1, 0, 0, 1}), 0, @@ -1322,34 +1320,34 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, TEST(ReferenceTopKTestInvalid, topk_v1_invalid_strings) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k = op::v0::Constant::create(element::i64, Shape{}, {1}); - EXPECT_THROW(opset1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); - EXPECT_THROW(opset1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); + EXPECT_THROW(op::v1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); + EXPECT_THROW(op::v1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2}); - EXPECT_THROW(opset1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f}); - EXPECT_THROW(opset1::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v1::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1}); - EXPECT_THROW(opset1::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v1::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); } class ReferenceTopKTestResnet50V3 : public ReferenceTopKTestResnet50 { private: static std::shared_ptr CreateFunction(const TopKParamsResnet50& params) { const auto A = std::make_shared(params.A.type, params.A.shape); - const auto B = std::make_shared(A, + const auto B = std::make_shared(A, op::v0::Constant::create(element::i64, {}, {5}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES); - const auto C = std::make_shared(A, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES); + const auto C = std::make_shared(A, op::v0::Constant::create(element::i64, {}, {1}), 1, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES); + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES); const auto out5_value = B->output(0); const auto out5_index = B->output(1); @@ -1375,7 +1373,7 @@ class ReferenceTopKTestMaxMinSortV3 : public ReferenceTopKTestMaxMinSort { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; } @@ -1395,7 +1393,7 @@ class ReferenceTopKTestBackendV3 : public ReferenceTopKTestBackend { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(B->outputs(), ParameterVector{A}); return f; } @@ -1415,7 +1413,7 @@ class ReferenceTopKTest1dMaxMinV3 : public ReferenceTopKTest1dMaxMin { static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; } @@ -1435,7 +1433,7 @@ class ReferenceTopKTestInt64V3 : public ReferenceTopKTestInt64 { static std::shared_ptr CreateFunction(const TopKParams& params, size_t out_idx) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort, element::i64); const auto f = std::make_shared(OutputVector{B->output(out_idx)}, ParameterVector{A}); return f; } @@ -1455,7 +1453,7 @@ class ReferenceTopKTestSingleOutputV3 : public ReferenceTopKTestSingleOutput { static std::shared_ptr CreateFunction(const TopKParams& params) { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); - const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); + const auto B = std::make_shared(A, k, params.axis, params.mode, params.sort); const auto f = std::make_shared(OutputVector{B->output(1)}, ParameterVector{A}); return f; } @@ -1473,18 +1471,18 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs, TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_strings) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k = op::v0::Constant::create(element::i64, Shape{}, {1}); - EXPECT_THROW(opset3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); - EXPECT_THROW(opset3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); + EXPECT_THROW(op::v3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure); + EXPECT_THROW(op::v3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure); } TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_k) { const auto data = std::make_shared(element::f32, Shape{1, 2, 3}); const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2}); - EXPECT_THROW(opset3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure); const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f}); - EXPECT_THROW(opset3::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v3::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure); const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1}); - EXPECT_THROW(opset3::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); + EXPECT_THROW(op::v3::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure); } class ReferenceTopKv11StableTest : public ReferenceTopKTest { @@ -1507,9 +1505,9 @@ class ReferenceTopKv11StableTest : public ReferenceTopKTest { const auto A = std::make_shared(params.A.type, params.A.shape); const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data()); const auto topk_stable = - std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, true); + std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, true); const auto topk_unstable = - std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, false); + std::make_shared(A, k, params.axis, params.mode, params.sort, params.result1.type, false); return std::make_shared( OutputVector{topk_stable->output(0), topk_stable->output(1), topk_unstable->output(0)}, @@ -1530,8 +1528,8 @@ std::vector generateParamsForStableTest() { TopKParams(reference_tests::Tensor(ET, {2, 7}, std::vector{5, 4, 3, 1, 7, 1, 3, 2, 1, 2, 5, 1, 7, 3}), reference_tests::Tensor(ET2, {}, std::vector{3}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 3}, std::vector{1, 1, 3, 1, 1, 2}), reference_tests::Tensor(ET_OUT, {2, 3}, std::vector{3, 5, 2, 1, 4, 0}), 0, @@ -1543,8 +1541,8 @@ std::vector generateParamsForStableTest() { }), reference_tests::Tensor(ET2, {}, std::vector{4}), 0, - opset1::TopK::Mode::MAX, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MAX, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {4, 3}, std::vector{8, 9, 5, 7, 8, 4, 7, 7, 3, 5, 7, 2}), reference_tests::Tensor(ET_OUT, {4, 3}, std::vector{5, 1, 4, 1, 3, 5, 4, 0, 6, 0, 2, 2}), 0, @@ -1554,8 +1552,8 @@ std::vector generateParamsForStableTest() { std::vector{1, 3, 3, 1, 2, 4, 2, 2, 3, 7, 7, 1, 7, 9, 7, 5, 7, 7}), reference_tests::Tensor(ET2, {}, std::vector{2}), 1, - opset1::TopK::Mode::MIN, - opset1::TopK::SortType::SORT_VALUES, + op::v1::TopK::Mode::MIN, + op::v1::TopK::SortType::SORT_VALUES, reference_tests::Tensor(ET, {2, 2, 3}, std::vector{1, 2, 3, 1, 2, 3, 5, 7, 1, 7, 7, 7}), reference_tests::Tensor(ET_OUT, {2, 2, 3}, std::vector{0, 1, 0, 1, 2, 2, 2, 0, 0, 0, 2, 1}), 0, From ba124917edfe19e16c0e8c60e93dd037ace50ec8 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 18:50:48 +0200 Subject: [PATCH 07/10] Use precise op version --- .../op_reference/deformable_psroi_pooling.cpp | 7 ++-- .../op_reference/depth_to_space.cpp | 10 +++--- .../tests/functional/op_reference/einsum.cpp | 6 ++-- .../op_reference/extract_image_patches.cpp | 5 ++- .../tests/functional/op_reference/gather.cpp | 11 +++--- .../functional/op_reference/gather_tree.cpp | 5 +-- .../tests/functional/op_reference/loop.cpp | 13 ++++--- .../op_reference/random_uniform.cpp | 5 +-- .../functional/op_reference/roi_align.cpp | 15 ++++---- .../tests/functional/op_reference/roll.cpp | 6 ++-- .../op_reference/shuffle_channels.cpp | 5 +-- .../tests/functional/op_reference/slice.cpp | 7 ++-- .../op_reference/space_to_batch.cpp | 6 ++-- .../op_reference/space_to_depth.cpp | 10 +++--- .../op_reference/tensor_iterator.cpp | 36 +++++++++++-------- .../tests/functional/op_reference/tile.cpp | 5 +-- .../disable_transformations_test.cpp | 7 ++-- 17 files changed, 85 insertions(+), 74 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/deformable_psroi_pooling.cpp b/src/plugins/template/tests/functional/op_reference/deformable_psroi_pooling.cpp index 858c5d287f4206..36f3e46b8d38ad 100644 --- a/src/plugins/template/tests/functional/op_reference/deformable_psroi_pooling.cpp +++ b/src/plugins/template/tests/functional/op_reference/deformable_psroi_pooling.cpp @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/deformable_psroi_pooling.hpp" + #include #include #include "base_reference_test.hpp" #include "openvino/op/psroi_pooling.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -186,7 +187,7 @@ class ReferenceDeformablePSROIPoolingLayerTest : public testing::TestWithParam(params.roisType, params.roisShape); if (params.offsetsShape.size() != 0) { const auto offsets = std::make_shared(params.offsetsType, params.offsetsShape); - const auto DeformablePSROIPooling = std::make_shared(input, + const auto DeformablePSROIPooling = std::make_shared(input, rois, offsets, params.outputDim, @@ -200,7 +201,7 @@ class ReferenceDeformablePSROIPoolingLayerTest : public testing::TestWithParam(NodeVector{DeformablePSROIPooling}, ParameterVector{input, rois, offsets}); } else { - const auto DeformablePSROIPooling = std::make_shared(input, + const auto DeformablePSROIPooling = std::make_shared(input, rois, params.outputDim, params.spatialScale, diff --git a/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp b/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp index 49beda3c56da59..83c91f93f92a11 100644 --- a/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp +++ b/src/plugins/template/tests/functional/op_reference/depth_to_space.cpp @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/depth_to_space.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -57,11 +58,10 @@ class ReferenceDepthToSpaceLayerTest : public testing::TestWithParam CreateFunction(const DepthToSpaceParams& params) { - opset1::DepthToSpace::DepthToSpaceMode mode = params.mode == "DEPTH_FIRST" - ? opset1::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST - : opset1::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST; + const auto mode = params.mode == "DEPTH_FIRST" ? op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST + : op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST; const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto depthToSpace = std::make_shared(data, mode, params.blockSize); + const auto depthToSpace = std::make_shared(data, mode, params.blockSize); return std::make_shared(NodeVector{depthToSpace}, ParameterVector{data}); } }; diff --git a/src/plugins/template/tests/functional/op_reference/einsum.cpp b/src/plugins/template/tests/functional/op_reference/einsum.cpp index 128c0ca7c427a1..e01dc16293e17e 100644 --- a/src/plugins/template/tests/functional/op_reference/einsum.cpp +++ b/src/plugins/template/tests/functional/op_reference/einsum.cpp @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/einsum.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset7.hpp" using namespace reference_tests; using namespace ov; @@ -61,7 +61,7 @@ class ReferenceEinsumTest : public testing::TestWithParam, public output_vector.push_back(param); param_vector.push_back(param); } - const auto einsum = std::make_shared(output_vector, params.equation); + const auto einsum = std::make_shared(output_vector, params.equation); const auto f = std::make_shared(OutputVector{einsum}, param_vector); return f; } diff --git a/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp b/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp index 8a2221f331be18..af82d7e3c74872 100644 --- a/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp +++ b/src/plugins/template/tests/functional/op_reference/extract_image_patches.cpp @@ -5,9 +5,8 @@ #include #include "base_reference_test.hpp" +#include "openvino/op/extractimagepatches.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset3.hpp" using namespace reference_tests; using namespace ov; @@ -63,7 +62,7 @@ class ReferenceExtractImagePatchesTest : public testing::TestWithParam CreateModel(const ExtractImagePatchesParams& params) { const auto data = std::make_shared(params.data.type, params.data.shape); - const auto extrace_image_patches = std::make_shared(data, + const auto extrace_image_patches = std::make_shared(data, params.sizes, params.strides, params.rates, diff --git a/src/plugins/template/tests/functional/op_reference/gather.cpp b/src/plugins/template/tests/functional/op_reference/gather.cpp index b7a0242e8caff5..99b1c82a8d91d8 100644 --- a/src/plugins/template/tests/functional/op_reference/gather.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather.cpp @@ -2,14 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/gather.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset7.hpp" -#include "openvino/opsets/opset8.hpp" using namespace reference_tests; using namespace ov; @@ -68,7 +67,7 @@ class ReferenceGatherTest : public testing::TestWithParam, public const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); - const auto G = std::make_shared(P, I, A); + const auto G = std::make_shared(P, I, A); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; } @@ -135,7 +134,7 @@ class ReferenceGatherTestV7 : public testing::TestWithParam, pub const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); - const auto G = std::make_shared(P, I, A, params.batchDims); + const auto G = std::make_shared(P, I, A, params.batchDims); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; } @@ -152,7 +151,7 @@ class ReferenceGatherTestV8 : public ReferenceGatherTestV7 { const auto I = std::make_shared(params.indicesTensor.type, params.indicesTensor.shape); const auto A = op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data()); - const auto G = std::make_shared(P, I, A, params.batchDims); + const auto G = std::make_shared(P, I, A, params.batchDims); const auto f = std::make_shared(G, ParameterVector{P, I}); return f; } diff --git a/src/plugins/template/tests/functional/op_reference/gather_tree.cpp b/src/plugins/template/tests/functional/op_reference/gather_tree.cpp index 65a97e8a151c07..57a8b796431fc2 100644 --- a/src/plugins/template/tests/functional/op_reference/gather_tree.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather_tree.cpp @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/gather_tree.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -64,7 +65,7 @@ class ReferenceGatherTreeTest : public testing::TestWithParam, const auto parent_idx = std::make_shared(params.parentIdx.type, params.parentIdx.shape); const auto max_seq_len = std::make_shared(params.maxSeqLen.type, params.maxSeqLen.shape); const auto end_token = std::make_shared(params.endToken.type, params.endToken.shape); - const auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); + const auto gather_tree = std::make_shared(step_ids, parent_idx, max_seq_len, end_token); const auto f = std::make_shared(gather_tree, ParameterVector{step_ids, parent_idx, max_seq_len, end_token}); return f; diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index 2fe7f1a8c03b70..e49443c6b74fcf 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/loop.hpp" + #include #include @@ -12,6 +14,7 @@ #include "functional_test_utils/skip_tests_config.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" #include "openvino/op/parameter.hpp" #include "openvino/op/result.hpp" @@ -49,18 +52,18 @@ struct LoopDynamicInputs : public LoopFunctionalBase { auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body auto sum = std::make_shared(Xi, Yi); - auto Zo = std::make_shared(sum, M_body); + auto Zo = std::make_shared(sum, M_body); auto body = std::make_shared(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body}); - auto loop = std::make_shared(trip_count, exec_condition); + auto loop = std::make_shared(trip_count, exec_condition); loop->set_function(body); loop->set_invariant_input(Xi, X); loop->set_invariant_input(Yi, Y); loop->set_merged_input(M_body, M, Zo); - loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0}); + loop->set_special_body_ports(ov::op::v5::Loop::SpecialBodyPorts{-1, 0}); // Output is last Zo auto result = std::make_shared(loop->get_iter_value(Zo, -1)); @@ -160,9 +163,9 @@ struct LoopStaticInputs : public LoopFunctionalBase { const auto body = std::make_shared(ov::OutputVector{body_condition_const, Zo}, body_params); - const auto loop = std::make_shared(trip_count_input, exec_condition); + const auto loop = std::make_shared(trip_count_input, exec_condition); loop->set_function(body); - loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0}); + loop->set_special_body_ports(ov::op::v5::Loop::SpecialBodyPorts{-1, 0}); for (size_t i = 0; i < body_params.size(); ++i) { if (loop_in_type[i] == LOOP_IN_TYPE::INVARIANT) { diff --git a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp index ac32cb4a828e7f..706a7217c1dbae 100644 --- a/src/plugins/template/tests/functional/op_reference/random_uniform.cpp +++ b/src/plugins/template/tests/functional/op_reference/random_uniform.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/random_uniform.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset8.hpp" using namespace ov; @@ -70,7 +71,7 @@ class ReferenceRandomUniformLayerTest : public testing::TestWithParam(max_val.type, max_val.shape); auto out_shape_ = std::make_shared(element::i64, Shape{out_shape.size()}, out_shape); - return std::make_shared(NodeVector{std::make_shared(out_shape_, + return std::make_shared(NodeVector{std::make_shared(out_shape_, min_val_param, max_val_param, out_type, diff --git a/src/plugins/template/tests/functional/op_reference/roi_align.cpp b/src/plugins/template/tests/functional/op_reference/roi_align.cpp index 3aba39c4b5582e..3bad155201bc2e 100644 --- a/src/plugins/template/tests/functional/op_reference/roi_align.cpp +++ b/src/plugins/template/tests/functional/op_reference/roi_align.cpp @@ -2,16 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/roi_align.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset3.hpp" -#include "openvino/opsets/opset4.hpp" -#include "openvino/opsets/opset5.hpp" -#include "openvino/opsets/opset9.hpp" using namespace reference_tests; using namespace ov; @@ -140,7 +137,7 @@ class ReferenceROIAlignTest : public testing::TestWithParam, pub std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); - const auto roi_align = std::make_shared(featureMap, + const auto roi_align = std::make_shared(featureMap, coords, roisIdx, params.pooledH, @@ -192,9 +189,9 @@ class ReferenceROIAlignV9Test : public testing::TestWithParam, std::make_shared(params.coords.type, params.coords.shape, params.coords.data.data()); const auto roisIdx = std::make_shared(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data()); - const auto pooling_mode = EnumNames::as_enum(params.poolingMode); - const auto aligned_mode = EnumNames::as_enum(params.alignedMode); - const auto roi_align = std::make_shared(featureMap, + const auto pooling_mode = EnumNames::as_enum(params.poolingMode); + const auto aligned_mode = EnumNames::as_enum(params.alignedMode); + const auto roi_align = std::make_shared(featureMap, coords, roisIdx, params.pooledH, diff --git a/src/plugins/template/tests/functional/op_reference/roll.cpp b/src/plugins/template/tests/functional/op_reference/roll.cpp index 938e2e65387d95..63293f1c323347 100644 --- a/src/plugins/template/tests/functional/op_reference/roll.cpp +++ b/src/plugins/template/tests/functional/op_reference/roll.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/roll.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset7.hpp" using namespace reference_tests; using namespace ov; @@ -70,7 +70,7 @@ class ReferenceRollLayerTest : public testing::TestWithParam, public const auto axes = std::make_shared(params.axesTensor.type, params.axesTensor.shape, params.axesTensor.data.data()); - const auto roll = std::make_shared(data, shift, axes); + const auto roll = std::make_shared(data, shift, axes); return std::make_shared(NodeVector{roll}, ParameterVector{data}); } }; diff --git a/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp b/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp index 8c73dbf25c265c..f3cd395bf4aadc 100644 --- a/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp +++ b/src/plugins/template/tests/functional/op_reference/shuffle_channels.cpp @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/shuffle_channels.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -61,7 +62,7 @@ class ReferenceShuffleChannelsLayerTest : public testing::TestWithParam CreateFunction(const ShuffleChannelsParams& params) { const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto function = std::make_shared(data, params.axis, params.group); + const auto function = std::make_shared(data, params.axis, params.group); return std::make_shared(NodeVector{function}, ParameterVector{data}); } }; diff --git a/src/plugins/template/tests/functional/op_reference/slice.cpp b/src/plugins/template/tests/functional/op_reference/slice.cpp index 0fec88e0f187c4..21455df6786460 100644 --- a/src/plugins/template/tests/functional/op_reference/slice.cpp +++ b/src/plugins/template/tests/functional/op_reference/slice.cpp @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/slice.hpp" + #include #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset8.hpp" using namespace ov; @@ -109,7 +110,7 @@ class ReferenceSliceLayerTest : public testing::TestWithParam, publ const auto step_param = std::make_shared(step.type, step.shape); const auto axes_param = std::make_shared(axes.type, axes.shape); - const auto slice = std::make_shared(data_param, start_param, stop_param, step_param, axes_param); + const auto slice = std::make_shared(data_param, start_param, stop_param, step_param, axes_param); return std::make_shared(NodeVector{slice}, ParameterVector{data_param, start_param, stop_param, step_param, axes_param}); } @@ -124,7 +125,7 @@ class ReferenceSliceLayerTest : public testing::TestWithParam, publ const auto stop_param = std::make_shared(stop.type, stop.shape); const auto step_param = std::make_shared(step.type, step.shape); - const auto slice = std::make_shared(data_param, start_param, stop_param, step_param); + const auto slice = std::make_shared(data_param, start_param, stop_param, step_param); return std::make_shared(NodeVector{slice}, ParameterVector{data_param, start_param, stop_param, step_param}); } diff --git a/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp b/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp index 40c60e3c766490..32bcf21cab7f3b 100644 --- a/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp +++ b/src/plugins/template/tests/functional/op_reference/space_to_batch.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/space_to_batch.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset2.hpp" using namespace reference_tests; using namespace ov; @@ -75,7 +75,7 @@ class ReferenceSpaceToBatchLayerTest : public testing::TestWithParam(element::i64, params.blockShapeTensor.shape); const auto padsBegin = std::make_shared(element::i64, params.padsBeginTensor.shape); const auto padsEnd = std::make_shared(element::i64, params.padsEndTensor.shape); - const auto batchToSpace = std::make_shared(data, blockShape, padsBegin, padsEnd); + const auto batchToSpace = std::make_shared(data, blockShape, padsBegin, padsEnd); return std::make_shared(NodeVector{batchToSpace}, ParameterVector{data, blockShape, padsBegin, padsEnd}); } diff --git a/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp b/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp index bcf90c0f31bb9e..19a6b71c03463c 100644 --- a/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp +++ b/src/plugins/template/tests/functional/op_reference/space_to_depth.cpp @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/space_to_depth.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -57,11 +58,10 @@ class ReferenceSpaceToDepthLayerTest : public testing::TestWithParam CreateFunction(const SpaceToDepthParams& params) { - opset1::SpaceToDepth::SpaceToDepthMode mode = params.mode == "DEPTH_FIRST" - ? opset1::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST - : opset1::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; + const auto mode = params.mode == "DEPTH_FIRST" ? op::v0::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST + : op::v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; const auto data = std::make_shared(params.dataTensor.type, params.dataTensor.shape); - const auto SpaceToDepth = std::make_shared(data, mode, params.blockSize); + const auto SpaceToDepth = std::make_shared(data, mode, params.blockSize); return std::make_shared(NodeVector{SpaceToDepth}, ParameterVector{data}); } }; diff --git a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp index 44c7bbfb876c03..477585ce5a7319 100644 --- a/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp +++ b/src/plugins/template/tests/functional/op_reference/tensor_iterator.cpp @@ -2,17 +2,23 @@ // SPDX-License-Identifier: Apache-2.0 // -#include +#include "openvino/op/tensor_iterator.hpp" -#include -#include +#include #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/core/model.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" +#include "openvino/op/gru_cell.hpp" +#include "openvino/op/lstm_cell.hpp" +#include "openvino/op/multiply.hpp" #include "openvino/op/parameter.hpp" #include "openvino/op/result.hpp" +#include "openvino/op/rnn_cell.hpp" +#include "openvino/op/squeeze.hpp" +#include "openvino/op/unsqueeze.hpp" namespace { struct TIFunctionalBase { @@ -42,11 +48,11 @@ struct TIDynamicInputs : public TIFunctionalBase { auto exec_condition = std::make_shared(ov::element::boolean, ov::Shape{1}, true); // Body auto sum = std::make_shared(Xi, Yi); - auto Zo = std::make_shared(sum, M_body); + auto Zo = std::make_shared(sum, M_body); auto body = std::make_shared(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body}); - auto tensor_iterator = std::make_shared(); + auto tensor_iterator = std::make_shared(); tensor_iterator->set_function(body); tensor_iterator->set_sliced_input(Xi, X, 0, 1, 1, -1, 1); @@ -261,7 +267,7 @@ struct TIStaticInputs : public TIStaticFunctionalBase { std::shared_ptr create_function(const TensorIteratorStaticParams& params) override { std::vector inputShapes; std::shared_ptr function; - auto tensor_iterator = std::make_shared(); + auto tensor_iterator = std::make_shared(); // Each case consist of 3 steps: // 1. Create TensorIterator body. @@ -294,13 +300,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase { ov::ParameterVector body_params{std::make_shared(params.iType, inputShapes[0]), std::make_shared(params.iType, inputShapes[1]), std::make_shared(params.iType, inputShapes[2])}; - auto squeeze = std::make_shared(body_params[0], axis); + auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1], body_params[2]}; auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); - auto lstm_cell = std::make_shared(out_vector[0], + auto lstm_cell = std::make_shared(out_vector[0], out_vector[1], out_vector[2], W, @@ -312,7 +318,7 @@ struct TIStaticInputs : public TIStaticFunctionalBase { std::vector{}, params.clip); - auto unsqueeze = std::make_shared(lstm_cell->output(0), axis); + auto unsqueeze = std::make_shared(lstm_cell->output(0), axis); ov::ResultVector results{std::make_shared(unsqueeze), std::make_shared(lstm_cell->output(0)), std::make_shared(lstm_cell->output(1))}; @@ -361,13 +367,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase { ov::ParameterVector body_params{std::make_shared(params.iType, inputShapes[0]), std::make_shared(params.iType, inputShapes[1])}; - auto squeeze = std::make_shared(body_params[0], axis); + auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1]}; auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); - auto gru_cell = std::make_shared(out_vector[0], + auto gru_cell = std::make_shared(out_vector[0], out_vector[1], W, R, @@ -379,7 +385,7 @@ struct TIStaticInputs : public TIStaticFunctionalBase { params.clip, false); - auto unsqueeze = std::make_shared(gru_cell->output(0), axis); + auto unsqueeze = std::make_shared(gru_cell->output(0), axis); ov::ResultVector results{std::make_shared(gru_cell->output(0)), std::make_shared(unsqueeze)}; auto body = std::make_shared(results, body_params, "gru_cell"); @@ -424,13 +430,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase { inputShapes[0][params.sequenceAxis] = 1; // sliced dimension ov::ParameterVector body_params{std::make_shared(params.iType, inputShapes[0]), std::make_shared(params.iType, inputShapes[1])}; - auto squeeze = std::make_shared(body_params[0], axis); + auto squeeze = std::make_shared(body_params[0], axis); ov::OutputVector out_vector = {squeeze, body_params[1]}; auto W = std::make_shared(params.W.type, params.W.shape, params.W.data.data()); auto R = std::make_shared(params.R.type, params.R.shape, params.R.data.data()); auto B = std::make_shared(params.B.type, params.B.shape, params.B.data.data()); - auto rnn_cell = std::make_shared(out_vector[0], + auto rnn_cell = std::make_shared(out_vector[0], out_vector[1], W, R, @@ -441,7 +447,7 @@ struct TIStaticInputs : public TIStaticFunctionalBase { std::vector{}, params.clip); - auto unsqueeze = std::make_shared(rnn_cell->output(0), axis); + auto unsqueeze = std::make_shared(rnn_cell->output(0), axis); ov::ResultVector results{std::make_shared(rnn_cell), std::make_shared(unsqueeze)}; auto body = std::make_shared(results, body_params, "rnn_cell"); diff --git a/src/plugins/template/tests/functional/op_reference/tile.cpp b/src/plugins/template/tests/functional/op_reference/tile.cpp index d59da515eda46b..6caa3d64154e95 100644 --- a/src/plugins/template/tests/functional/op_reference/tile.cpp +++ b/src/plugins/template/tests/functional/op_reference/tile.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/tile.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; @@ -60,7 +61,7 @@ class ReferenceTileTest : public testing::TestWithParam, public Comm const auto A = std::make_shared(params.A.type, params.A.shape); const auto repeats = std::make_shared(params.repeats.type, params.repeats.shape, params.repeats.data.data()); - const auto tile = std::make_shared(A, repeats); + const auto tile = std::make_shared(A, repeats); const auto f = std::make_shared(NodeVector{tile}, ParameterVector{A}); return f; } diff --git a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp index 82fe2916737b09..7d5f878869f4ec 100644 --- a/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp +++ b/src/plugins/template/tests/functional/transformations/disable_transformations_test.cpp @@ -12,8 +12,9 @@ #include "common_test_utils/ov_test_utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" #include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/convert_like.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset11.hpp" #include "template/properties.hpp" TEST(DisableTransformationsTests, TestTemplatePluginProperty) { @@ -21,13 +22,13 @@ TEST(DisableTransformationsTests, TestTemplatePluginProperty) { { auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); auto like = ov::op::v0::Constant::create(ov::element::i32, ov::Shape{1}, {1}); - auto cvtlike = std::make_shared(data, like); + auto cvtlike = std::make_shared(data, like); m = std::make_shared(ov::NodeVector{cvtlike}, ov::ParameterVector{data}); } { auto data = std::make_shared(ov::element::f32, ov::Shape{3, 1, 2}); - auto cvt = std::make_shared(data, ov::element::i32); + auto cvt = std::make_shared(data, ov::element::i32); m_ref = std::make_shared(ov::NodeVector{cvt}, ov::ParameterVector{data}); } From df8b637f455a1ac7eee5e49d090a7a596bb41049 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 19:08:11 +0200 Subject: [PATCH 08/10] Include openvino headers in quotes --- src/plugins/template/src/itt.hpp | 2 +- .../tests/functional/op_reference/binary_convolution.cpp | 1 - .../tests/functional/op_reference/convert_color_i420.cpp | 6 +++--- .../tests/functional/op_reference/convert_color_nv12.cpp | 6 +++--- .../functional/op_reference/embedding_segments_sum.cpp | 3 +-- .../functional/op_reference/embeddingbag_offsetssum.cpp | 3 +-- .../functional/op_reference/embeddingbag_packedsum.cpp | 3 +-- .../op_reference/group_convolution_backprop.cpp | 1 - src/plugins/template/tests/functional/op_reference/if.cpp | 4 ++-- .../template/tests/functional/op_reference/loop.cpp | 4 +--- .../template/tests/functional/op_reference/pad.cpp | 3 +-- .../tests/functional/op_reference/prior_box_clustered.cpp | 3 ++- .../ov_executable_network/ov_exec_net_import_export.cpp | 3 +-- .../functional/subgraph_reference/preprocess_opencv.cpp | 8 ++++---- 14 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/plugins/template/src/itt.hpp b/src/plugins/template/src/itt.hpp index d8153bcff90ab6..a48f85ef747165 100644 --- a/src/plugins/template/src/itt.hpp +++ b/src/plugins/template/src/itt.hpp @@ -9,7 +9,7 @@ #pragma once -#include +#include "openvino/itt.hpp" namespace ov { namespace template_plugin { diff --git a/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp b/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp index 66cf759a43309d..6b6089911a197c 100644 --- a/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp +++ b/src/plugins/template/tests/functional/op_reference/binary_convolution.cpp @@ -8,7 +8,6 @@ #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" -#include "openvino/opsets/opset8.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/convert_color_i420.cpp b/src/plugins/template/tests/functional/op_reference/convert_color_i420.cpp index 844fdeb116344c..2e9747596965b6 100644 --- a/src/plugins/template/tests/functional/op_reference/convert_color_i420.cpp +++ b/src/plugins/template/tests/functional/op_reference/convert_color_i420.cpp @@ -4,13 +4,13 @@ #include -#include -#include -#include #include #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/core/model.hpp" +#include "openvino/op/i420_to_bgr.hpp" +#include "openvino/op/i420_to_rgb.hpp" using namespace ov; using namespace InferenceEngine; diff --git a/src/plugins/template/tests/functional/op_reference/convert_color_nv12.cpp b/src/plugins/template/tests/functional/op_reference/convert_color_nv12.cpp index 26d9c31bae3f1e..77781766478765 100644 --- a/src/plugins/template/tests/functional/op_reference/convert_color_nv12.cpp +++ b/src/plugins/template/tests/functional/op_reference/convert_color_nv12.cpp @@ -4,13 +4,13 @@ #include -#include -#include -#include #include #include "base_reference_test.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/core/model.hpp" +#include "openvino/op/nv12_to_bgr.hpp" +#include "openvino/op/nv12_to_rgb.hpp" using namespace ov; using namespace InferenceEngine; diff --git a/src/plugins/template/tests/functional/op_reference/embedding_segments_sum.cpp b/src/plugins/template/tests/functional/op_reference/embedding_segments_sum.cpp index d308d2c2a5d69f..4726ccdffd6a51 100644 --- a/src/plugins/template/tests/functional/op_reference/embedding_segments_sum.cpp +++ b/src/plugins/template/tests/functional/op_reference/embedding_segments_sum.cpp @@ -4,9 +4,8 @@ #include -#include - #include "base_reference_test.hpp" +#include "shared_test_classes/base/layer_test_utils.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/embeddingbag_offsetssum.cpp b/src/plugins/template/tests/functional/op_reference/embeddingbag_offsetssum.cpp index f7e7bdcafaa7f0..9967e99b8e2317 100644 --- a/src/plugins/template/tests/functional/op_reference/embeddingbag_offsetssum.cpp +++ b/src/plugins/template/tests/functional/op_reference/embeddingbag_offsetssum.cpp @@ -4,9 +4,8 @@ #include -#include - #include "base_reference_test.hpp" +#include "shared_test_classes/base/layer_test_utils.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/embeddingbag_packedsum.cpp b/src/plugins/template/tests/functional/op_reference/embeddingbag_packedsum.cpp index 80af12d4053c8f..ea9dfe34decb22 100644 --- a/src/plugins/template/tests/functional/op_reference/embeddingbag_packedsum.cpp +++ b/src/plugins/template/tests/functional/op_reference/embeddingbag_packedsum.cpp @@ -4,9 +4,8 @@ #include -#include - #include "base_reference_test.hpp" +#include "shared_test_classes/base/layer_test_utils.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp index f1081bf95537ff..b378fe18cc27cf 100644 --- a/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp +++ b/src/plugins/template/tests/functional/op_reference/group_convolution_backprop.cpp @@ -7,7 +7,6 @@ #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/group_conv.hpp" -#include "openvino/opsets/opset8.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/if.cpp b/src/plugins/template/tests/functional/op_reference/if.cpp index 81b454c01484cf..eef66bb3e5ad61 100644 --- a/src/plugins/template/tests/functional/op_reference/if.cpp +++ b/src/plugins/template/tests/functional/op_reference/if.cpp @@ -5,11 +5,11 @@ #include #include -#include #include -#include #include "base_reference_test.hpp" +#include "ie_core.hpp" +#include "shared_test_classes/base/layer_test_utils.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/loop.cpp b/src/plugins/template/tests/functional/op_reference/loop.cpp index e49443c6b74fcf..ffdbc0b8dc6ee2 100644 --- a/src/plugins/template/tests/functional/op_reference/loop.cpp +++ b/src/plugins/template/tests/functional/op_reference/loop.cpp @@ -6,12 +6,10 @@ #include -#include -#include - #include "base_reference_test.hpp" #include "common_test_utils/common_utils.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/core/model.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/multiply.hpp" diff --git a/src/plugins/template/tests/functional/op_reference/pad.cpp b/src/plugins/template/tests/functional/op_reference/pad.cpp index eca5f7dbd074a7..4396aadf415661 100644 --- a/src/plugins/template/tests/functional/op_reference/pad.cpp +++ b/src/plugins/template/tests/functional/op_reference/pad.cpp @@ -6,9 +6,8 @@ #include -#include - #include "base_reference_test.hpp" +#include "functional_test_utils/skip_tests_config.hpp" #include "openvino/op/constant.hpp" using namespace reference_tests; diff --git a/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp b/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp index a1332125d4e20e..358477ee9ed40a 100644 --- a/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp +++ b/src/plugins/template/tests/functional/op_reference/prior_box_clustered.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/prior_box_clustered.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/prior_box.hpp" -#include "openvino/opsets/opset1.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_executable_network/ov_exec_net_import_export.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_executable_network/ov_exec_net_import_export.cpp index 391c2919c26e74..388150d628600b 100644 --- a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_executable_network/ov_exec_net_import_export.cpp +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_executable_network/ov_exec_net_import_export.cpp @@ -1,9 +1,8 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // -#include - #include "behavior/compiled_model/import_export.hpp" +#include "common_test_utils/test_constants.hpp" #include "ie_plugin_config.hpp" using namespace ov::test::behavior; diff --git a/src/plugins/template/tests/functional/subgraph_reference/preprocess_opencv.cpp b/src/plugins/template/tests/functional/subgraph_reference/preprocess_opencv.cpp index 32b4097eb58550..a19631713ad3c1 100644 --- a/src/plugins/template/tests/functional/subgraph_reference/preprocess_opencv.cpp +++ b/src/plugins/template/tests/functional/subgraph_reference/preprocess_opencv.cpp @@ -8,13 +8,13 @@ # include # include -# include -# include -# include -# include # include "base_reference_test.hpp" +# include "openvino/core/preprocess/pre_post_process.hpp" # include "ov_models/builders.hpp" +# include "shared_test_classes/base/layer_test_utils.hpp" +# include "shared_test_classes/single_layer/convert_color_i420.hpp" +# include "shared_test_classes/single_layer/convert_color_nv12.hpp" using namespace ov; using namespace ov::preprocess; From 48d5a525a5e53db7aae5998a5587cfca2d8608b4 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Mon, 9 Oct 2023 19:13:12 +0200 Subject: [PATCH 09/10] Use precise op version - LSTMCell --- .../tests/functional/op_reference/lstm_cell.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp b/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp index ac5e2e53e8cb84..7b8686dcaf8c4b 100644 --- a/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp +++ b/src/plugins/template/tests/functional/op_reference/lstm_cell.cpp @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/lstm_cell.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/opsets/opset1.hpp" -#include "openvino/opsets/opset4.hpp" using namespace reference_tests; using namespace ov; @@ -93,7 +93,7 @@ class ReferenceLSTMCellTest : public testing::TestWithParam, pub const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = - std::make_shared(X, + std::make_shared(X, H_t, C_t, op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC), @@ -126,7 +126,7 @@ class ReferenceLSTMCellTestBiasDefaultAttrs : public ReferenceLSTMCellTest { const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = - std::make_shared(X, + std::make_shared(X, H_t, C_t, op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC), @@ -160,7 +160,7 @@ class ReferenceLSTMCellTestBiasClip : public ReferenceLSTMCellTest { const auto C_t = std::make_shared(params.C_t.type, params.C_t.shape); const auto B = std::make_shared(params.B.type, params.B.shape); - const auto lstm_cell = std::make_shared(X, + const auto lstm_cell = std::make_shared(X, H_t, C_t, W, @@ -200,7 +200,7 @@ class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest { const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = - std::make_shared(X, + std::make_shared(X, H_t, C_t, op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC), @@ -224,7 +224,7 @@ class ReferenceLSTMCellV1TestBiasDefaultAttrs : public ReferenceLSTMCellTestBias const auto B = std::make_shared(params.B.type, params.B.shape); const auto lstm_cell = - std::make_shared(X, + std::make_shared(X, H_t, C_t, op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC), @@ -265,7 +265,7 @@ class ReferenceLSTMCellV1TestBiasClip : public ReferenceLSTMCellTestBiasClip { const auto B = std::make_shared(params.B.type, params.B.shape); const auto P = std::make_shared(params.P.type, params.P.shape); - const auto lstm_cell = std::make_shared(X, + const auto lstm_cell = std::make_shared(X, H_t, C_t, W, From d6d076795c0a0c847cd5bc5971880499bb2adfd6 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Tue, 10 Oct 2023 09:26:59 +0200 Subject: [PATCH 10/10] Fix code style --- .../tests/functional/op_reference/non_max_suppression.cpp | 3 ++- src/plugins/template/tests/functional/op_reference/topk.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp index 9e623162a7418b..7a3e8f28b03550 100644 --- a/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp +++ b/src/plugins/template/tests/functional/op_reference/non_max_suppression.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/non_max_suppression.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/op/non_max_suppression.hpp" using namespace reference_tests; using namespace ov; diff --git a/src/plugins/template/tests/functional/op_reference/topk.cpp b/src/plugins/template/tests/functional/op_reference/topk.cpp index 45e50eced49679..b702a97519d1db 100644 --- a/src/plugins/template/tests/functional/op_reference/topk.cpp +++ b/src/plugins/template/tests/functional/op_reference/topk.cpp @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/op/topk.hpp" + #include #include "base_reference_test.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/parameter.hpp" -#include "openvino/op/topk.hpp" using namespace reference_tests; using namespace ov;