From fe58c12627cba532358270f60a4169ef33643144 Mon Sep 17 00:00:00 2001 From: Patryk Elszkowski Date: Wed, 21 Jul 2021 08:02:28 +0200 Subject: [PATCH] update maste to feature branch --- .../tests/functional/op_reference/grn.cpp | 36 +++++++++---------- .../tests/functional/op_reference/select.cpp | 9 ++--- .../tests/functional/op_reference/sign.cpp | 25 ++++++------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/docs/template_plugin/tests/functional/op_reference/grn.cpp b/docs/template_plugin/tests/functional/op_reference/grn.cpp index 9df1dc1428772b..e7fc0c79f6b82b 100644 --- a/docs/template_plugin/tests/functional/op_reference/grn.cpp +++ b/docs/template_plugin/tests/functional/op_reference/grn.cpp @@ -19,15 +19,15 @@ using namespace InferenceEngine; namespace { struct GrnParams { template - GrnParams(const float bias, const ngraph::PartialShape& shape, const ngraph::element::Type& iType, const std::vector& iValues, + GrnParams(const float bias, const PartialShape& shape, const element::Type& iType, const std::vector& iValues, const std::vector& oValues) : bias(bias), pshape(shape), inType(iType), outType(iType), inputData(CreateBlob(iType, iValues)), refData(CreateBlob(iType, oValues)) {} float bias; - ngraph::PartialShape pshape; - ngraph::element::Type inType; - ngraph::element::Type outType; - InferenceEngine::Blob::Ptr inputData; - InferenceEngine::Blob::Ptr refData; + PartialShape pshape; + element::Type inType; + element::Type outType; + Blob::Ptr inputData; + Blob::Ptr refData; }; class ReferenceGrnLayerTest : public testing::TestWithParam, public CommonReferenceTest { @@ -61,21 +61,21 @@ TEST_P(ReferenceGrnLayerTest, CompareWithHardcodedRefs) { } template -std::vector generateGrnParams(const ngraph::element::Type& type) { +std::vector generateGrnParams(const element::Type& type) { using T = typename element_type_traits::value_type; std::vector grnParams { // bias 1e-6 // 2D // 3D // 4D - GrnParams(1e-6, ngraph::PartialShape {3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + GrnParams(1e-6, PartialShape {3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, std::vector {0.182574, 0.365148, 0.547723, 0.730297, 0.379049, 0.454859, 0.530669, 0.606478, 0.426162, 0.473514, 0.520865, 0.568217}), - GrnParams(1e-6, ngraph::PartialShape {2, 3, 4}, type, + GrnParams(1e-6, PartialShape {2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, std::vector {0.0966737, 0.169031, 0.224231, 0.267261, 0.483368, 0.507093, 0.523205, 0.534522, 0.870063, 0.845154, 0.822179, 0.801784, 0.433574, 0.441836, 0.449215, 0.455842, 0.566982, 0.568075, 0.569005, 0.569803, 0.700389, 0.694314, 0.688796, 0.683763}), - GrnParams(1e-6, ngraph::PartialShape {1, 2, 3, 4}, type, + GrnParams(1e-6, PartialShape {1, 2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, std::vector {0.0766965, 0.141421, 0.196116, 0.242536, 0.282166, 0.316228, 0.345705, 0.371391, 0.393919, 0.413803, 0.431455, 0.447214, 0.997055, 0.989949, 0.980581, 0.970143, 0.959365, 0.948683, 0.938343, 0.928477, 0.919145, 0.910366, 0.902134, 0.894427}), - GrnParams(1e-6, ngraph::PartialShape {2, 2, 3, 4}, type, + GrnParams(1e-6, PartialShape {2, 2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48}, std::vector {0.0766965, 0.141421, 0.196116, 0.242536, 0.282166, 0.316228, 0.345705, 0.371391, 0.393919, 0.413803, 0.431455, 0.447214, @@ -83,17 +83,17 @@ std::vector generateGrnParams(const ngraph::element::Type& type) { 0.559857, 0.564684, 0.56921, 0.573462, 0.577465, 0.581238, 0.584802, 0.588172, 0.591364, 0.594391, 0.597266, 0.6, 0.828589, 0.825307, 0.822192, 0.819232, 0.816416, 0.813733, 0.811176, 0.808736, 0.806405, 0.804176, 0.802043, 0.8}), // bias 100.25 // 2D // 3D // 4D - GrnParams(100.25, ngraph::PartialShape {3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, + GrnParams(100.25, PartialShape {3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, std::vector {0.0876216, 0.175243, 0.262865, 0.350486, 0.301923, 0.362308, 0.422693, 0.483077, 0.385076, 0.427863, 0.470649, 0.513435}), - GrnParams(100.25, ngraph::PartialShape {2, 3, 4}, type, + GrnParams(100.25, PartialShape {2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, std::vector {0.0694629, 0.129032, 0.179525, 0.222137, 0.347314, 0.387097, 0.418891, 0.444273, 0.625166, 0.645161, 0.658258, 0.66641, 0.41125, 0.421303, 0.430287, 0.438356, 0.537789, 0.541675, 0.54503, 0.547945, 0.664327, 0.662047, 0.659774, 0.657534}), - GrnParams(100.25, ngraph::PartialShape {1, 2, 3, 4}, type, + GrnParams(100.25, PartialShape {1, 2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, std::vector {0.0608299, 0.115422, 0.164091, 0.207321, 0.245662, 0.279675, 0.309889, 0.336786, 0.360795, 0.38229, 0.401596, 0.418994, 0.790789, 0.807954, 0.820457, 0.829283, 0.835252, 0.839026, 0.841128, 0.841965, 0.841854, 0.841037, 0.839701, 0.837989f}), - GrnParams(100.25, ngraph::PartialShape {2, 2, 3, 4}, type, + GrnParams(100.25, PartialShape {2, 2, 3, 4}, type, std::vector {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48}, std::vector {0.0608299, 0.115422, 0.164091, 0.207321, 0.245662, 0.279675, 0.309889, 0.336786, 0.360795, 0.38229, 0.401596, 0.418994, @@ -104,9 +104,9 @@ std::vector generateGrnParams(const ngraph::element::Type& type) { } std::vector generateGrnCombinedParams() { - const std::vector> grnTypeParams {generateGrnParams(ngraph::element::bf16), - generateGrnParams(ngraph::element::f16), - generateGrnParams(ngraph::element::f32)}; + const std::vector> grnTypeParams {generateGrnParams(element::bf16), + generateGrnParams(element::f16), + generateGrnParams(element::f32)}; std::vector combinedParams; std::for_each(grnTypeParams.begin(), grnTypeParams.end(), [&](std::vector params) { combinedParams.insert(combinedParams.end(), params.begin(), params.end()); diff --git a/docs/template_plugin/tests/functional/op_reference/select.cpp b/docs/template_plugin/tests/functional/op_reference/select.cpp index c4dec3f8172e83..0cbc242c61b202 100644 --- a/docs/template_plugin/tests/functional/op_reference/select.cpp +++ b/docs/template_plugin/tests/functional/op_reference/select.cpp @@ -12,6 +12,7 @@ #include "base_reference_test.hpp" +using namespace reference_tests; using namespace ngraph; using namespace InferenceEngine; @@ -33,12 +34,12 @@ struct SelectParams { element::Type data_type; op::AutoBroadcastSpec broadcast; PartialShape select_input_pshape; - InferenceEngine::Blob::Ptr select_input; + Blob::Ptr select_input; PartialShape if_input_pshape; - InferenceEngine::Blob::Ptr if_input; + Blob::Ptr if_input; PartialShape else_input_pshape; - InferenceEngine::Blob::Ptr else_input; - InferenceEngine::Blob::Ptr expected_output; + Blob::Ptr else_input; + Blob::Ptr expected_output; }; class ReferenceSelectLayerTest : public testing::TestWithParam, public CommonReferenceTest { diff --git a/docs/template_plugin/tests/functional/op_reference/sign.cpp b/docs/template_plugin/tests/functional/op_reference/sign.cpp index a5ff9b11978a90..ca1505cea1368e 100644 --- a/docs/template_plugin/tests/functional/op_reference/sign.cpp +++ b/docs/template_plugin/tests/functional/op_reference/sign.cpp @@ -12,19 +12,20 @@ #include "base_reference_test.hpp" +using namespace reference_tests; using namespace ngraph; using namespace InferenceEngine; struct SignParams { template - SignParams(const ngraph::PartialShape& shape, const ngraph::element::Type& iType, const ngraph::element::Type& oType, const std::vector& iValues, + SignParams(const PartialShape& shape, const element::Type& iType, const element::Type& oType, const std::vector& iValues, const std::vector& oValues) : pshape(shape), inType(iType), outType(oType), inputData(CreateBlob(iType, iValues)), refData(CreateBlob(oType, oValues)) {} - ngraph::PartialShape pshape; - ngraph::element::Type inType; - ngraph::element::Type outType; - InferenceEngine::Blob::Ptr inputData; - InferenceEngine::Blob::Ptr refData; + PartialShape pshape; + element::Type inType; + element::Type outType; + Blob::Ptr inputData; + Blob::Ptr refData; }; class ReferenceSignLayerTest : public testing::TestWithParam, public CommonReferenceTest { @@ -59,22 +60,22 @@ TEST_P(ReferenceSignLayerTest, CompareWithHardcodedRefs) { INSTANTIATE_TEST_SUITE_P( smoke_Sign_With_Hardcoded_Refs, ReferenceSignLayerTest, ::testing::Values( - SignParams(ngraph::PartialShape {6}, ngraph::element::f32, ngraph::element::f32, + SignParams(PartialShape {6}, element::f32, element::f32, std::vector {1, -2, 0, -4.8f, 4.8f, -0.0f}, std::vector {1, -1, 0, -1, 1, 0}), - SignParams(ngraph::PartialShape {6}, ngraph::element::f16, ngraph::element::f16, + SignParams(PartialShape {6}, element::f16, element::f16, std::vector {1, -2, 0, -4.8f, 4.8f, -0.0f}, std::vector {1, -1, 0, -1, 1, 0}), - SignParams(ngraph::PartialShape {6}, ngraph::element::u64, ngraph::element::u64, + SignParams(PartialShape {6}, element::u64, element::u64, std::vector {1, 2, 0, 4, 4, 0}, std::vector {1, 1, 0, 1, 1, 0}), - SignParams(ngraph::PartialShape {6}, ngraph::element::u32, ngraph::element::u32, + SignParams(PartialShape {6}, element::u32, element::u32, std::vector {1, 2, 0, 4, 4, 0}, std::vector {1, 1, 0, 1, 1, 0}), - SignParams(ngraph::PartialShape {6}, ngraph::element::i32, ngraph::element::i32, + SignParams(PartialShape {6}, element::i32, element::i32, std::vector {1, -2, 0, -4, 4, -0}, std::vector {1, -1, 0, -1, 1, 0}), - SignParams(ngraph::PartialShape {6}, ngraph::element::i64, ngraph::element::i64, + SignParams(PartialShape {6}, element::i64, element::i64, std::vector {1, -2, 0, -4, 4, -0}, std::vector {1, -1, 0, -1, 1, 0})), ReferenceSignLayerTest::getTestCaseName);