From 7a31382f96357cc4e14d8e5939551538f0be426a Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Wed, 10 Apr 2024 20:50:57 +0200 Subject: [PATCH] [Tmpl test] CumSum: enable whole Tensor comparison (#23862) ### Details: - Used actual shapes for Tensors creation. ### Tickets: - CVS-137153 --------- Co-authored-by: Michal Lukaszewski --- .../tests/functional/op_reference/cum_sum.cpp | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/cum_sum.cpp b/src/plugins/template/tests/functional/op_reference/cum_sum.cpp index dbb6b9e1dad..13c23ebf0bf 100644 --- a/src/plugins/template/tests/functional/op_reference/cum_sum.cpp +++ b/src/plugins/template/tests/functional/op_reference/cum_sum.cpp @@ -15,7 +15,7 @@ namespace { struct CumSumParams { // Custom axis input and attributes template - CumSumParams(const PartialShape& shape, + CumSumParams(const Shape& shape, const element::Type& iType, const std::vector& iValues, const std::vector& oValues, @@ -23,7 +23,7 @@ struct CumSumParams { const bool reverse, const element::Type& axisType, AT axisVal, - const PartialShape& axisShape) + const Shape& axisShape) : execlusive(execlusive), reverse(reverse), axisValue(axisVal), @@ -33,13 +33,13 @@ struct CumSumParams { inType(iType), outType(iType), axisData(CreateTensor(axisType, std::vector{axisVal})), - inputData(CreateTensor(iType, iValues)), - refData(CreateTensor(iType, oValues)), + inputData(CreateTensor(shape, iType, iValues)), + refData(CreateTensor(shape, iType, oValues)), testDefaults(false) {} // Default axis input and attributes template - CumSumParams(const PartialShape& shape, + CumSumParams(const Shape& shape, const element::Type& iType, const std::vector& iValues, const std::vector& oValues) @@ -47,16 +47,16 @@ struct CumSumParams { axisType(element::i32), inType(iType), outType(iType), - inputData(CreateTensor(iType, iValues)), - refData(CreateTensor(iType, oValues)), + inputData(CreateTensor(shape, iType, iValues)), + refData(CreateTensor(shape, iType, oValues)), testDefaults(true) {} bool execlusive = false; bool reverse = false; int64_t axisValue = 0; - PartialShape axisShape; - PartialShape inShape; + Shape axisShape; + Shape inShape; element::Type axisType; element::Type inType; element::Type outType; @@ -102,9 +102,9 @@ public: } private: - static std::shared_ptr CreateFunction(const PartialShape& data_shape, + static std::shared_ptr CreateFunction(const Shape& data_shape, const element::Type& data_type, - const PartialShape& axis_shape, + const Shape& axis_shape, const element::Type& axis_type, const bool execlusive, const bool reverse) { @@ -114,7 +114,7 @@ private: return std::make_shared(NodeVector{cum_sum}, ParameterVector{data_param, axis_param}); } - static std::shared_ptr CreateFunction(const PartialShape& data_shape, const element::Type& data_type) { + static std::shared_ptr CreateFunction(const Shape& data_shape, const element::Type& data_type) { const auto data_param = std::make_shared(data_type, data_shape); const auto cum_sum = std::make_shared(data_param); return std::make_shared(NodeVector{cum_sum}, ParameterVector{data_param}); @@ -130,14 +130,14 @@ std::vector generateCumSumParams(const element::Type& type) { using T = typename element_type_traits::value_type; std::vector opParams{ // Default axis input and attributes - CumSumParams(PartialShape{1}, type, std::vector{3}, std::vector{3}), - CumSumParams(PartialShape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{1, 3, 6, 10, 15, 21}), - CumSumParams(PartialShape{2, 4}, + CumSumParams(Shape{1}, type, std::vector{3}, std::vector{3}), + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{1, 3, 6, 10, 15, 21}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{0, 1, 2, 3, 4, 6, 8, 10}), // Custom axis input and attributes - CumSumParams(PartialShape{6}, + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{1, 3, 6, 10, 15, 21}, @@ -145,8 +145,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(0), - PartialShape{}), // axis i32 - CumSumParams(PartialShape{6}, + Shape{}), // axis i32 + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{1, 3, 6, 10, 15, 21}, @@ -154,8 +154,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i64, int64_t(0), - PartialShape{}), // axis i64 - CumSumParams(PartialShape{6}, + Shape{}), // axis i64 + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{21, 20, 18, 15, 11, 6}, @@ -163,8 +163,8 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i64, int64_t(0), - PartialShape{}), - CumSumParams(PartialShape{6}, + Shape{}), + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{0, 1, 3, 6, 10, 15}, @@ -172,8 +172,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i64, int64_t(0), - PartialShape{}), - CumSumParams(PartialShape{6}, + Shape{}), + CumSumParams(Shape{6}, type, std::vector{1, 2, 3, 4, 5, 6}, std::vector{20, 18, 15, 11, 6, 0}, @@ -181,9 +181,9 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i64, int64_t(0), - PartialShape{}), + Shape{}), - CumSumParams(PartialShape{2, 4}, + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{0, 1, 2, 3, 4, 6, 8, 10}, @@ -191,8 +191,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(0), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{4, 6, 8, 10, 4, 5, 6, 7}, @@ -200,8 +200,8 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i32, int32_t(0), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{0, 0, 0, 0, 0, 1, 2, 3}, @@ -209,8 +209,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(0), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{4, 5, 6, 7, 0, 0, 0, 0}, @@ -218,8 +218,8 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i32, int32_t(0), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{0, 1, 3, 6, 4, 9, 15, 22}, @@ -227,8 +227,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(1), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{0, 0, 1, 3, 0, 4, 9, 15}, @@ -236,8 +236,8 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(1), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{6, 6, 5, 3, 22, 18, 13, 7}, @@ -245,8 +245,8 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i32, int32_t(1), - PartialShape{}), - CumSumParams(PartialShape{2, 4}, + Shape{}), + CumSumParams(Shape{2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7}, std::vector{6, 5, 3, 0, 18, 13, 7, 0}, @@ -254,10 +254,10 @@ std::vector generateCumSumParams(const element::Type& type) { true, element::i32, int32_t(1), - PartialShape{}), + Shape{}), CumSumParams( - PartialShape{3, 2, 4}, + Shape{3, 2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 27, 30, 33, 36, 39, 42, 45}, @@ -265,9 +265,9 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(0), - PartialShape{}), + Shape{}), CumSumParams( - PartialShape{3, 2, 4}, + Shape{3, 2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, std::vector{0, 1, 2, 3, 4, 6, 8, 10, 8, 9, 10, 11, 20, 22, 24, 26, 16, 17, 18, 19, 36, 38, 40, 42}, @@ -275,9 +275,9 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(1), - PartialShape{}), + Shape{}), CumSumParams( - PartialShape{3, 2, 4}, + Shape{3, 2, 4}, type, std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, std::vector{0, 1, 3, 6, 4, 9, 15, 22, 8, 17, 27, 38, 12, 25, 39, 54, 16, 33, 51, 70, 20, 41, 63, 86}, @@ -285,7 +285,7 @@ std::vector generateCumSumParams(const element::Type& type) { false, element::i32, int32_t(2), - PartialShape{}), + Shape{}), }; return opParams; }