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] FloorMod: enable whole Tensor comparison #23966

Merged
Changes from all commits
Commits
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
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
Loading