Correct the order of passing arguments to the InputGenerateData constructor (Fix Round, Ceiling Conformance tests for Template plugin) (#11099)

* Correct the order of passing arguments to the InputGenerateData constructor

* Full range correction for random numbers

* Refactoring the argument sequence of the InputGenerateData class constructor

* A small imperfection

* Rollback changes that are related to range
This commit is contained in:
Nikita Semaev
2022-04-01 13:42:10 +03:00
committed by GitHub
parent 6eaa15745a
commit dc55f8bb5a
2 changed files with 20 additions and 20 deletions

View File

@@ -18,32 +18,32 @@ namespace test {
namespace utils {
struct InputGenerateData {
uint32_t range;
int32_t start_from;
uint32_t range;
int32_t resolution;
int seed;
InputGenerateData(uint32_t _range = 10, int32_t _start_from = 0, int32_t _resolution = 1, int _seed = 1)
: range(_range), start_from(_start_from), resolution(_resolution), seed(_seed) {}
InputGenerateData(int32_t _start_from = 0, uint32_t _range = 10, int32_t _resolution = 1, int _seed = 1)
: start_from(_start_from), range(_range), resolution(_resolution), seed(_seed) {}
};
static std::map<ov::NodeTypeInfo, std::vector<std::vector<InputGenerateData>>> inputRanges = {
// NodeTypeInfo: {IntRanges{}, RealRanges{}} (Ranges are used by generate<ov::Node>)
{ ov::op::v0::Erf::get_type_info_static(), {{{6, -3}}, {{6, -3, 10}}} },
{ ov::op::v1::Divide::get_type_info_static(), {{{100, 101}}, {{2, 2, 128}}} },
{ ov::op::v1::FloorMod::get_type_info_static(), {{{4, 2}}, {{2, 2, 128}}} },
{ ov::op::v1::Mod::get_type_info_static(), {{{4, 2}}, {{2, 2, 128}}} },
{ ov::op::v1::ReduceMax::get_type_info_static(), {{{5, 0}}, {{5, -5, 1000}}} },
{ ov::op::v1::ReduceMean::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::ReduceMin::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::ReduceProd::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v1::Power::get_type_info_static(), {{{4, 2}}, {{2, 2, 128}}} },
{ ov::op::v4::Proposal::get_type_info_static(), {{{1, 0, 1000, 8234231}}, {{1, 0, 1000, 8234231}}} },
{ ov::op::v4::ReduceL1::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v4::ReduceL2::get_type_info_static(), {{{5, 0}}, {{5, 0, 1000}}} },
{ ov::op::v0::Erf::get_type_info_static(), {{{-3, 6}}, {{-3, 6, 10}}} },
{ ov::op::v1::Divide::get_type_info_static(), {{{101, 100}}, {{2, 2, 128}}} },
{ ov::op::v1::FloorMod::get_type_info_static(), {{{2, 4}}, {{2, 2, 128}}} },
{ ov::op::v1::Mod::get_type_info_static(), {{{2, 4}}, {{2, 2, 128}}} },
{ ov::op::v1::ReduceMax::get_type_info_static(), {{{0, 5}}, {{-5, 5, 1000}}} },
{ ov::op::v1::ReduceMean::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::ReduceMin::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::ReduceProd::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::ReduceSum::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v1::Power::get_type_info_static(), {{{2, 4}}, {{2, 2, 128}}} },
{ ov::op::v4::Proposal::get_type_info_static(), {{{0, 1, 1000, 8234231}}, {{0, 1, 1000, 8234231}}} },
{ ov::op::v4::ReduceL1::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
{ ov::op::v4::ReduceL2::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
};
} // namespace utils

View File

@@ -113,8 +113,8 @@ ov::runtime::Tensor generate(const std::shared_ptr<ngraph::op::v0::DetectionOutp
const ov::element::Type& elemType,
const ov::Shape& targetShape) {
InputGenerateData inGenData;
inGenData.range = 1;
inGenData.start_from = 0;
inGenData.range = 1;
switch (port) {
case 1:
@@ -419,8 +419,8 @@ ov::runtime::Tensor generate(const std::shared_ptr<ngraph::op::v1::GatherTree>&
case 2:
case 3: {
InputGenerateData inGenData;
inGenData.range = maxBeamIndx;
inGenData.start_from = maxBeamIndx / 2;
inGenData.range = maxBeamIndx;
return ov::test::utils::create_and_fill_tensor(elemType, targetShape, inGenData.range, inGenData.start_from, inGenData.resolution, inGenData.seed);
}
default: