diff --git a/src/plugins/template/tests/functional/op_reference/prior_box.cpp b/src/plugins/template/tests/functional/op_reference/prior_box.cpp index 687952ae23a..898ce279a76 100644 --- a/src/plugins/template/tests/functional/op_reference/prior_box.cpp +++ b/src/plugins/template/tests/functional/op_reference/prior_box.cpp @@ -18,20 +18,17 @@ struct PriorBoxParams { PriorBoxParams(const std::vector& min_size, const std::vector& aspect_ratio, const bool scale_all_size, - const ov::Shape& layerShapeShape, - const ov::Shape& imageShapeShape, const ov::element::Type& iType, const std::vector& layerShapeValues, const std::vector& imageShapeValues, + const Shape& output_shape, const std::vector& oValues, const std::string& testcaseName = "") - : layerShapeShape(layerShapeShape), - imageShapeShape(imageShapeShape), - inType(iType), + : inType(iType), outType(ov::element::Type_t::f32), - layerShapeData(CreateTensor(iType, layerShapeValues)), - imageShapeData(CreateTensor(iType, imageShapeValues)), - refData(CreateTensor(outType, oValues)), + layerShapeData(CreateTensor(Shape{2}, iType, layerShapeValues)), + imageShapeData(CreateTensor(Shape{2}, iType, imageShapeValues)), + refData(CreateTensor(output_shape, outType, oValues)), testcaseName(testcaseName) { attrs.min_size = min_size; attrs.aspect_ratio = aspect_ratio; @@ -39,8 +36,6 @@ struct PriorBoxParams { } ov::op::v0::PriorBox::Attributes attrs; - ov::Shape layerShapeShape; - ov::Shape imageShapeShape; ov::element::Type inType; ov::element::Type outType; ov::Tensor layerShapeData; @@ -56,20 +51,17 @@ struct PriorBoxV8Params { const std::vector& aspect_ratio, const bool scale_all_size, const bool min_max_aspect_ratios_order, - const ov::Shape& layerShapeShape, - const ov::Shape& imageShapeShape, const ov::element::Type& iType, const std::vector& layerShapeValues, const std::vector& imageShapeValues, + const Shape& output_shape, const std::vector& oValues, const std::string& testcaseName = "") - : layerShapeShape(layerShapeShape), - imageShapeShape(imageShapeShape), - inType(iType), + : inType(iType), outType(ov::element::Type_t::f32), - layerShapeData(CreateTensor(iType, layerShapeValues)), - imageShapeData(CreateTensor(iType, imageShapeValues)), - refData(CreateTensor(outType, oValues)), + layerShapeData(CreateTensor(Shape{2}, iType, layerShapeValues)), + imageShapeData(CreateTensor(Shape{2}, iType, imageShapeValues)), + refData(CreateTensor(output_shape, outType, oValues)), testcaseName(testcaseName) { attrs.min_size = min_size; attrs.max_size = max_size; @@ -79,8 +71,6 @@ struct PriorBoxV8Params { } ov::op::v8::PriorBox::Attributes attrs; - ov::Shape layerShapeShape; - ov::Shape imageShapeShape; ov::element::Type inType; ov::element::Type outType; ov::Tensor layerShapeData; @@ -92,30 +82,25 @@ struct PriorBoxV8Params { class ReferencePriorBoxLayerTest : public testing::TestWithParam, public CommonReferenceTest { public: void SetUp() override { - legacy_compare = true; - auto params = GetParam(); + const auto& params = GetParam(); function = CreateFunction(params); inputData = {}; refOutData = {params.refData}; } static std::string getTestCaseName(const testing::TestParamInfo& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; - result << "layerShapeShape=" << param.layerShapeShape << "_"; - result << "imageShapeShape=" << param.imageShapeShape << "_"; result << "iType=" << param.inType << "_"; result << "oType=" << param.outType; - if (param.testcaseName != "") + if (!param.testcaseName.empty()) result << "_" << param.testcaseName; return result.str(); } private: static std::shared_ptr CreateFunction(const PriorBoxParams& params) { - auto LS = - std::make_shared(params.inType, params.layerShapeShape, params.layerShapeData.data()); - auto IS = - std::make_shared(params.inType, params.imageShapeShape, params.imageShapeData.data()); + const auto LS = std::make_shared(params.layerShapeData); + const auto IS = std::make_shared(params.imageShapeData); const auto PriorBox = std::make_shared(LS, IS, params.attrs); return std::make_shared(NodeVector{PriorBox}, ParameterVector{}); } @@ -124,30 +109,25 @@ private: class ReferencePriorBoxV8LayerTest : public testing::TestWithParam, public CommonReferenceTest { public: void SetUp() override { - legacy_compare = true; - auto params = GetParam(); + const auto& params = GetParam(); function = CreateFunction(params); inputData = {}; refOutData = {params.refData}; } static std::string getTestCaseName(const testing::TestParamInfo& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; - result << "layerShapeShape=" << param.layerShapeShape << "_"; - result << "imageShapeShape=" << param.imageShapeShape << "_"; result << "iType=" << param.inType << "_"; result << "oType=" << param.outType; - if (param.testcaseName != "") + if (!param.testcaseName.empty()) result << "_" << param.testcaseName; return result.str(); } private: static std::shared_ptr CreateFunction(const PriorBoxV8Params& params) { - auto LS = - std::make_shared(params.inType, params.layerShapeShape, params.layerShapeData.data()); - auto IS = - std::make_shared(params.inType, params.imageShapeShape, params.imageShapeData.data()); + const auto LS = std::make_shared(params.layerShapeData); + const auto IS = std::make_shared(params.imageShapeData); const auto PriorBoxV8 = std::make_shared(LS, IS, params.attrs); return std::make_shared(NodeVector{PriorBoxV8}, ParameterVector{}); } @@ -169,11 +149,10 @@ std::vector generatePriorBoxFloatParams() { PriorBoxParams({2.0f}, {1.5f}, false, - {2}, - {2}, IN_ET, std::vector{2, 2}, std::vector{10, 10}, + Shape{2, 32}, std::vector{-0.75, -0.75, 1.25, 1.25, -0.974745, -0.566497, 1.47474, 1.0665, -0.25, -0.75, 1.75, 1.25, -0.474745, -0.566497, 1.97474, 1.0665, -0.75, -0.25, 1.25, 1.75, -0.974745, -0.0664966, 1.47474, 1.5665, @@ -197,11 +176,10 @@ std::vector generatePriorBoxV8FloatParams() { {1.5f}, true, false, - {2}, - {2}, IN_ET, std::vector{2, 2}, std::vector{10, 10}, + Shape{2, 48}, std::vector{ 0.15, 0.15, 0.35, 0.35, 0.127526, 0.16835, 0.372474, 0.33165, 0.0918861, 0.0918861, 0.408114, 0.408114, 0.65, 0.15, 0.85, 0.35, 0.627526, 0.16835, 0.872474, 0.33165, 0.591886, 0.0918861, 0.908114, 0.408114, 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 2088b4e3dca..5af2dc82937 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 @@ -19,21 +19,18 @@ struct PriorBoxClusteredParams { PriorBoxClusteredParams(const std::vector& widths, const std::vector& heights, const bool clip, - const ov::Shape& layerShapeShape, - const ov::Shape& imageShapeShape, const ov::element::Type& iType, const std::vector& layerShapeValues, const std::vector& imageShapeValues, + const Shape& output_shape, const std::vector& oValues, const std::vector& variances = {}, const std::string& testcaseName = "") - : layerShapeShape(layerShapeShape), - imageShapeShape(imageShapeShape), - inType(iType), + : inType(iType), outType(ov::element::Type_t::f32), - layerShapeData(CreateTensor(iType, layerShapeValues)), - imageShapeData(CreateTensor(iType, imageShapeValues)), - refData(CreateTensor(outType, oValues)), + layerShapeData(CreateTensor(Shape{2}, iType, layerShapeValues)), + imageShapeData(CreateTensor(Shape{2}, iType, imageShapeValues)), + refData(CreateTensor(output_shape, outType, oValues)), testcaseName(testcaseName) { attrs.widths = widths; attrs.heights = heights; @@ -43,8 +40,6 @@ struct PriorBoxClusteredParams { } ov::op::v0::PriorBoxClustered::Attributes attrs; - ov::Shape layerShapeShape; - ov::Shape imageShapeShape; ov::element::Type inType; ov::element::Type outType; ov::Tensor layerShapeData; @@ -57,17 +52,14 @@ class ReferencePriorBoxClusteredLayerTest : public testing::TestWithParam& obj) { - auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; - result << "layerShapeShape=" << param.layerShapeShape << "_"; - result << "imageShapeShape=" << param.imageShapeShape << "_"; result << "variancesSize=" << param.attrs.variances.size() << "_"; result << "iType=" << param.inType << "_"; result << "oType=" << param.outType; @@ -78,10 +70,8 @@ public: private: static std::shared_ptr CreateFunction(const PriorBoxClusteredParams& params) { - auto LS = - std::make_shared(params.inType, params.layerShapeShape, params.layerShapeData.data()); - auto IS = - std::make_shared(params.inType, params.imageShapeShape, params.imageShapeData.data()); + auto LS = std::make_shared(params.layerShapeData); + auto IS = std::make_shared(params.imageShapeData); const auto PriorBoxClustered = std::make_shared(LS, IS, params.attrs); return std::make_shared(NodeVector{PriorBoxClustered}, ParameterVector{}); } @@ -100,11 +90,10 @@ std::vector generatePriorBoxClusteredFloatParams() { {3.0f}, {3.0f}, true, - {2}, - {2}, IN_ET, std::vector{2, 2}, std::vector{10, 10}, + Shape{2, 16}, std::vector{0, 0, 0.15f, 0.15f, 0.34999f, 0, 0.64999f, 0.15f, 0, 0.34999f, 0.15f, 0.64999f, 0.34999f, 0.34999f, 0.64999f, 0.64999f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, @@ -113,11 +102,10 @@ std::vector generatePriorBoxClusteredFloatParams() { {3.0f}, {3.0f}, true, - {2}, - {2}, IN_ET, std::vector{2, 2}, std::vector{10, 10}, + Shape{2, 16}, std::vector{0, 0, 0.15f, 0.15f, 0.34999f, 0, 0.64999f, 0.15f, 0, 0.34999f, 0.15f, 0.64999f, 0.34999f, 0.34999f, 0.64999f, 0.64999f, 0.1f, 0.2f, 0.3f, 0.4f, 0.1f, 0.2f, 0.3f, 0.4f,