Skip to content

Commit

Permalink
[Tmpl test] FloorMod: enable whole Tensor comparison (openvinotoolkit…
Browse files Browse the repository at this point in the history
…#23966)

### Details:
 - Added expected shape.

### Tickets:
 - CVS-137162
  • Loading branch information
t-jankowski authored Apr 11, 2024
1 parent 2eb09a4 commit 2a86e64
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/plugins/template/tests/functional/op_reference/floor_mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct FloorModParams {
template <class IT>
FloorModParams(const PartialShape& iShape1,
const PartialShape& iShape2,
const Shape& oShape,
const element::Type& iType,
const std::vector<IT>& iValues1,
const std::vector<IT>& iValues2,
Expand All @@ -27,7 +28,7 @@ struct FloorModParams {
outType(iType),
inputData1(CreateTensor(iType, iValues1)),
inputData2(CreateTensor(iType, iValues2)),
refData(CreateTensor(iType, oValues)) {}
refData(CreateTensor(oShape, iType, oValues)) {}

PartialShape pshape1;
PartialShape pshape2;
Expand All @@ -41,15 +42,14 @@ struct FloorModParams {
class ReferenceFloorModLayerTest : public testing::TestWithParam<FloorModParams>, public CommonReferenceTest {
public:
void SetUp() override {
legacy_compare = true;
auto params = GetParam();
const auto& params = GetParam();
function = CreateFunction(params.pshape1, params.pshape2, params.inType, params.outType);
inputData = {params.inputData1, params.inputData2};
refOutData = {params.refData};
}

static std::string getTestCaseName(const testing::TestParamInfo<FloorModParams>& obj) {
auto param = obj.param;
const auto& param = obj.param;
std::ostringstream result;
result << "iShape1=" << param.pshape1 << "_";
result << "iShape2=" << param.pshape2 << "_";
Expand Down Expand Up @@ -81,6 +81,7 @@ std::vector<FloorModParams> generateParamsForFloorMod() {

std::vector<FloorModParams> params{FloorModParams(ov::PartialShape{4},
ov::PartialShape{4},
ov::Shape{4},
IN_ET,
std::vector<T>{7, -7, 7, -7},
std::vector<T>{3, 3, -3, -3},
Expand All @@ -95,6 +96,7 @@ std::vector<FloorModParams> generateParamsForFloorModBroadcast() {
std::vector<FloorModParams> params{
FloorModParams(ov::PartialShape{2, 1, 2},
ov::PartialShape{2, 1},
ov::Shape{2, 2, 2},
IN_ET,
std::vector<T>{1, 2, 3, 4},
std::vector<T>{2, 3},
Expand All @@ -110,6 +112,7 @@ std::vector<FloorModParams> generateParamsForFloorModScalar() {
std::vector<FloorModParams> params{
FloorModParams(ov::PartialShape{1},
ov::PartialShape{1},
ov::Shape{1},
IN_ET,
std::vector<T>{2},
std::vector<T>{4},
Expand All @@ -122,7 +125,7 @@ template <element::Type_t IN_ET>
std::vector<FloorModParams> generateParamsForFloorModNonIntegerDivisor() {
using T = typename element_type_traits<IN_ET>::value_type;
// clang-format off
return {FloorModParams(ov::PartialShape{8}, ov::PartialShape{8}, IN_ET,
return {FloorModParams(ov::PartialShape{8}, ov::PartialShape{8}, ov::Shape{8}, IN_ET,
std::vector<T>{-3.2, -3.1, -3.0, 5.0, 5.1, 5.2, -1.6, 1.6},
std::vector<T>{-3.1, -3.1, -3.1, -5.1, -5.1, -5.1, 1.7, 1.7},
std::vector<T>{-0.1, -0.0, -3.0, -0.1, -0.0, -5.0, 0.1, 1.6})};
Expand Down

0 comments on commit 2a86e64

Please sign in to comment.