Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Tmpl test] CumSum: enable whole Tensor comparison #23862

Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
74a6436
Enhance ref vs out data comparison in template test
t-jankowski Mar 4, 2024
213bfc0
Enhance ref vs out data comparison in template test
t-jankowski Mar 5, 2024
2bfcf1a
Add Tensor comparizon
t-jankowski Mar 5, 2024
b12e3a8
Enhance ref vs out data comparison in template test
t-jankowski Mar 6, 2024
8c8cbff
Keep legacy comparison
t-jankowski Mar 6, 2024
e15d719
Fix style
t-jankowski Mar 12, 2024
01af380
Use legacy comparison for Tan ref test
t-jankowski Mar 13, 2024
890ae27
Merge remote-tracking branch 'upstream/master' into tj/plugin/templat…
t-jankowski Mar 13, 2024
dd10733
Merge remote-tracking branch 'upstream/master' into tj/plugin/templat…
t-jankowski Mar 25, 2024
e4d8f06
Use leagcy comparison for MaxPool and Mish
t-jankowski Mar 25, 2024
719398e
Merge remote-tracking branch 'upstream/master' into tj/plugin/templat…
t-jankowski Mar 25, 2024
e05e0b8
Merge branch 'master' into tj/plugin/template/test/compare-tensor
mlukasze Mar 26, 2024
077af8a
Merge branch 'master' into tj/plugin/template/test/compare-tensor
t-jankowski Mar 26, 2024
5561073
Merge branch 'master' into tj/plugin/template/test/compare-tensor
t-jankowski Mar 28, 2024
6df849d
Merge branch 'master' into tj/plugin/template/test/compare-tensor
t-jankowski Mar 28, 2024
7abbbd1
Merge remote-tracking branch 'upstream/master' into tj/plugin/templat…
t-jankowski Mar 29, 2024
0a39f97
Merge branch 'master' into tj/plugin/template/test/compare-tensor
mlukasze Apr 2, 2024
46c4a3d
Merge branch 'master' into tj/plugin/template/test/compare-tensor
t-jankowski Apr 3, 2024
94cb70d
Enable whole Tensor comparison
t-jankowski Apr 3, 2024
12667fe
Merge remote-tracking branch 'upstream/master' into tj/plugin/templat…
t-jankowski Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions src/plugins/template/tests/functional/op_reference/cum_sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace {
struct CumSumParams {
// Custom axis input and attributes
template <class IT, class AT>
CumSumParams(const PartialShape& shape,
CumSumParams(const Shape& shape,
const element::Type& iType,
const std::vector<IT>& iValues,
const std::vector<IT>& oValues,
const bool execlusive,
const bool reverse,
const element::Type& axisType,
AT axisVal,
const PartialShape& axisShape)
const Shape& axisShape)
: execlusive(execlusive),
reverse(reverse),
axisValue(axisVal),
Expand All @@ -33,30 +33,30 @@ struct CumSumParams {
inType(iType),
outType(iType),
axisData(CreateTensor(axisType, std::vector<AT>{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 <class IT>
CumSumParams(const PartialShape& shape,
CumSumParams(const Shape& shape,
const element::Type& iType,
const std::vector<IT>& iValues,
const std::vector<IT>& oValues)
: inShape(shape),
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;
Expand Down Expand Up @@ -102,9 +102,9 @@ class ReferenceCumSumLayerTest : public testing::TestWithParam<CumSumParams>, pu
}

private:
static std::shared_ptr<Model> CreateFunction(const PartialShape& data_shape,
static std::shared_ptr<Model> 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) {
Expand All @@ -114,7 +114,7 @@ class ReferenceCumSumLayerTest : public testing::TestWithParam<CumSumParams>, pu
return std::make_shared<ov::Model>(NodeVector{cum_sum}, ParameterVector{data_param, axis_param});
}

static std::shared_ptr<Model> CreateFunction(const PartialShape& data_shape, const element::Type& data_type) {
static std::shared_ptr<Model> CreateFunction(const Shape& data_shape, const element::Type& data_type) {
const auto data_param = std::make_shared<op::v0::Parameter>(data_type, data_shape);
const auto cum_sum = std::make_shared<op::v0::CumSum>(data_param);
return std::make_shared<ov::Model>(NodeVector{cum_sum}, ParameterVector{data_param});
Expand All @@ -130,162 +130,162 @@ std::vector<CumSumParams> generateCumSumParams(const element::Type& type) {
using T = typename element_type_traits<IN_ET>::value_type;
std::vector<CumSumParams> opParams{
// Default axis input and attributes
CumSumParams(PartialShape{1}, type, std::vector<T>{3}, std::vector<T>{3}),
CumSumParams(PartialShape{6}, type, std::vector<T>{1, 2, 3, 4, 5, 6}, std::vector<T>{1, 3, 6, 10, 15, 21}),
CumSumParams(PartialShape{2, 4},
CumSumParams(Shape{1}, type, std::vector<T>{3}, std::vector<T>{3}),
CumSumParams(Shape{6}, type, std::vector<T>{1, 2, 3, 4, 5, 6}, std::vector<T>{1, 3, 6, 10, 15, 21}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{0, 1, 2, 3, 4, 6, 8, 10}),
// Custom axis input and attributes
CumSumParams(PartialShape{6},
CumSumParams(Shape{6},
type,
std::vector<T>{1, 2, 3, 4, 5, 6},
std::vector<T>{1, 3, 6, 10, 15, 21},
false,
false,
element::i32,
int32_t(0),
PartialShape{}), // axis i32
CumSumParams(PartialShape{6},
Shape{}), // axis i32
CumSumParams(Shape{6},
type,
std::vector<T>{1, 2, 3, 4, 5, 6},
std::vector<T>{1, 3, 6, 10, 15, 21},
false,
false,
element::i64,
int64_t(0),
PartialShape{}), // axis i64
CumSumParams(PartialShape{6},
Shape{}), // axis i64
CumSumParams(Shape{6},
type,
std::vector<T>{1, 2, 3, 4, 5, 6},
std::vector<T>{21, 20, 18, 15, 11, 6},
false,
true,
element::i64,
int64_t(0),
PartialShape{}),
CumSumParams(PartialShape{6},
Shape{}),
CumSumParams(Shape{6},
type,
std::vector<T>{1, 2, 3, 4, 5, 6},
std::vector<T>{0, 1, 3, 6, 10, 15},
true,
false,
element::i64,
int64_t(0),
PartialShape{}),
CumSumParams(PartialShape{6},
Shape{}),
CumSumParams(Shape{6},
type,
std::vector<T>{1, 2, 3, 4, 5, 6},
std::vector<T>{20, 18, 15, 11, 6, 0},
true,
true,
element::i64,
int64_t(0),
PartialShape{}),
Shape{}),

CumSumParams(PartialShape{2, 4},
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{0, 1, 2, 3, 4, 6, 8, 10},
false,
false,
element::i32,
int32_t(0),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{4, 6, 8, 10, 4, 5, 6, 7},
false,
true,
element::i32,
int32_t(0),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{0, 0, 0, 0, 0, 1, 2, 3},
true,
false,
element::i32,
int32_t(0),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{4, 5, 6, 7, 0, 0, 0, 0},
true,
true,
element::i32,
int32_t(0),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{0, 1, 3, 6, 4, 9, 15, 22},
false,
false,
element::i32,
int32_t(1),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{0, 0, 1, 3, 0, 4, 9, 15},
true,
false,
element::i32,
int32_t(1),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{6, 6, 5, 3, 22, 18, 13, 7},
false,
true,
element::i32,
int32_t(1),
PartialShape{}),
CumSumParams(PartialShape{2, 4},
Shape{}),
CumSumParams(Shape{2, 4},
type,
std::vector<T>{0, 1, 2, 3, 4, 5, 6, 7},
std::vector<T>{6, 5, 3, 0, 18, 13, 7, 0},
true,
true,
element::i32,
int32_t(1),
PartialShape{}),
Shape{}),

CumSumParams(
PartialShape{3, 2, 4},
Shape{3, 2, 4},
type,
std::vector<T>{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<T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 27, 30, 33, 36, 39, 42, 45},
false,
false,
element::i32,
int32_t(0),
PartialShape{}),
Shape{}),
CumSumParams(
PartialShape{3, 2, 4},
Shape{3, 2, 4},
type,
std::vector<T>{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<T>{0, 1, 2, 3, 4, 6, 8, 10, 8, 9, 10, 11, 20, 22, 24, 26, 16, 17, 18, 19, 36, 38, 40, 42},
false,
false,
element::i32,
int32_t(1),
PartialShape{}),
Shape{}),
CumSumParams(
PartialShape{3, 2, 4},
Shape{3, 2, 4},
type,
std::vector<T>{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<T>{0, 1, 3, 6, 4, 9, 15, 22, 8, 17, 27, 38, 12, 25, 39, 54, 16, 33, 51, 70, 20, 41, 63, 86},
false,
false,
element::i32,
int32_t(2),
PartialShape{}),
Shape{}),
};
return opParams;
}
Expand Down
Loading