Skip to content

Commit

Permalink
update ReshapeLayerTest to have unsigned in output axis (openvinotool…
Browse files Browse the repository at this point in the history
  • Loading branch information
pelszkow authored and andrei-cv committed Aug 30, 2021
1 parent 4af40bf commit fc01604
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const std::vector<InferenceEngine::Precision> netPrecisions = {
};

INSTANTIATE_TEST_SUITE_P(
smoke_ReshapeCheckDynBatch, ReshapeLayerTestRevise,
smoke_ReshapeCheckDynBatch, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true), ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
Expand All @@ -27,10 +27,10 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(std::vector<int64_t>({30, 30, 30, 30})),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(
smoke_ReshapeCheck, ReshapeLayerTestRevise,
smoke_ReshapeCheck, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true), ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
Expand All @@ -41,10 +41,10 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(std::vector<int64_t>({10, 0, 100})),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(
smoke_ReshapeCheckNegative, ReshapeLayerTestRevise,
smoke_ReshapeCheckNegative, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true), ::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
Expand All @@ -55,5 +55,5 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(std::vector<int64_t>({10, -1, 100})),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using namespace LayerTestsDefinitions;

namespace {
TEST_P(ReshapeLayerTestRevise, Serialize) {
TEST_P(ReshapeLayerTest, Serialize) {
Serialize();
}

Expand All @@ -19,7 +19,7 @@ namespace {
InferenceEngine::Precision::FP16
};

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeSerialization, ReshapeLayerTestRevise,
INSTANTIATE_TEST_CASE_P(smoke_ReshapeSerialization, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -31,5 +31,5 @@ namespace {
::testing::Values(std::vector<int64_t>({30, 30, 30, 30})),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(std::map<std::string, std::string>({{CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_VALUE(YES)}}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16
};

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckDynBatch, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckDynBatch, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -27,9 +27,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckDynBatch, ReshapeLayerTestRevise,
::testing::Values(std::vector<int64_t>({30, 30, 30, 30})),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(std::map<std::string, std::string>({{CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_VALUE(YES)}}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -41,9 +41,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTestRevise,
::testing::Values(std::vector<int64_t>({10, 0, 100})),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -55,5 +55,5 @@ INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTestRevise,
::testing::Values(std::vector<int64_t>({10, -1, 100})),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const std::vector<InferenceEngine::Precision> netPrecisions = {
};

//TODO: Issue : - 28981
INSTANTIATE_TEST_SUITE_P(DISABLE_smoke_ReshapeCheckDynBatch, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(DISABLE_smoke_ReshapeCheckDynBatch, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -28,9 +28,9 @@ INSTANTIATE_TEST_SUITE_P(DISABLE_smoke_ReshapeCheckDynBatch, ReshapeLayerTestRev
::testing::Values(std::vector<int64_t>({1, 0, 256})),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(std::map<std::string, std::string>({{CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_VALUE(YES)}}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -42,9 +42,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTestRevise,
::testing::Values(std::vector<int64_t>({10, 0, 100})),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTestRevise,
INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTest,
::testing::Combine(
::testing::Values(true),
::testing::ValuesIn(netPrecisions),
Expand All @@ -56,5 +56,5 @@ INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckNegative, ReshapeLayerTestRevise,
::testing::Values(std::vector<int64_t>({10, -1, 100})),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(std::map<std::string, std::string>({}))),
ReshapeLayerTestRevise::getTestCaseName);
ReshapeLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,18 @@

namespace LayerTestsDefinitions {

//TODO: remove this alias when ticket 57975 is done - ticket: 57976
typedef std::tuple<bool, // SpecialZero
InferenceEngine::Precision, // Network precision
InferenceEngine::Precision, // Input precision
InferenceEngine::Precision, // Output precision
InferenceEngine::Layout, // Input layout
InferenceEngine::Layout, // Output layout
std::vector<size_t>, // Input shapes
std::vector<size_t>, // OutForm Shapes
std::vector<int64_t>, // OutForm Shapes
std::string, // Device name
std::map<std::string, std::string> // Config
>
reshapeParams;

//TODO: remove this class when ticket 57975 is done - ticket: 57976
class ReshapeLayerTest : public testing::WithParamInterface<reshapeParams>,
virtual public LayerTestsUtils::LayerTestsCommon {
public:
Expand All @@ -41,7 +38,7 @@ class ReshapeLayerTest : public testing::WithParamInterface<reshapeParams>,
};


//TODO: use this alias in all dependencies - ticket: 57975
//TODO: Drop this Revise impl when all pluging will switch back to ReshapeLayerTest
typedef std::tuple<bool, // SpecialZero
InferenceEngine::Precision, // Network precision
InferenceEngine::Precision, // Input precision
Expand All @@ -55,7 +52,6 @@ typedef std::tuple<bool, // SpecialZero
>
reshapeParamsRevise;

//TODO: use this class in all dependencies - ticket: 57975
class ReshapeLayerTestRevise
: public testing::WithParamInterface<reshapeParamsRevise>,
virtual public LayerTestsUtils::LayerTestsCommon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ std::string ReshapeLayerTest::getTestCaseName(testing::TestParamInfo<reshapePara
InferenceEngine::Precision netPrecision;
InferenceEngine::Precision inPrc, outPrc;
InferenceEngine::Layout inLayout, outLayout;
InferenceEngine::SizeVector inputShapes, outFormShapes;
InferenceEngine::SizeVector inputShapes;
std::vector<int64_t> outFormShapes;
std::string targetDevice;
std::map<std::string, std::string> config;
bool specialZero;
Expand All @@ -28,7 +29,8 @@ std::string ReshapeLayerTest::getTestCaseName(testing::TestParamInfo<reshapePara
}

void ReshapeLayerTest::SetUp() {
InferenceEngine::SizeVector inputShapes, outFormShapes;
InferenceEngine::SizeVector inputShapes;
std::vector<int64_t> outFormShapes;
bool specialZero;
InferenceEngine::Precision netPrecision;
std::tie(specialZero, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShapes, outFormShapes, targetDevice, configuration) =
Expand Down

0 comments on commit fc01604

Please sign in to comment.