add SLT for activation function with integer type to check rounding (#5506)

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
This commit is contained in:
Patryk ElszkowskiandPatryk Elszkowski authored and GitHub committed 2021-05-19 08:41:35 +03:00
1 parent 76131da7ca
commit 4bbbf66a69
1 file changed
+21
@@ -22,6 +22,10 @@ const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP16
};
const std::vector<InferenceEngine::Precision> intPrecisions = {
InferenceEngine::Precision::I32,
};
const std::map<ActivationTypes, std::vector<std::vector<float>>> activationTypes = {
{Sigmoid, {}},
{Tanh, {}},
@@ -58,6 +62,12 @@ const std::map<ActivationTypes, std::vector<std::vector<float>>> activationTypes
{GeluTanh, {}}
};
// List of operations that should be tested also with integer precision
const std::map<ActivationTypes, std::vector<std::vector<float>>> intActivationTypes = {
{Sqrt, {}},
{Tanh, {}},
};
const std::map<ActivationTypes, std::vector<std::vector<float>>> activationParamTypes = {
{PReLu, {{-0.01f}}},
{LeakyRelu, {{0.01f}}}
@@ -105,8 +115,19 @@ const auto basicPreluCases = ::testing::Combine(
::testing::Values(CommonTestUtils::DEVICE_CPU)
);
const auto basicIntegerOperations = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(intActivationTypes)),
::testing::ValuesIn(intPrecisions),
::testing::ValuesIn(intPrecisions),
::testing::ValuesIn(intPrecisions),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(CommonTestUtils::combineParams(basic)),
::testing::Values(CommonTestUtils::DEVICE_CPU)
);
INSTANTIATE_TEST_CASE_P(smoke_Activation_Basic, ActivationLayerTest, basicCases, ActivationLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Integer_Activation_Basic, ActivationLayerTest, basicIntegerOperations, ActivationLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Activation_Basic_Prelu, ActivationLayerTest, basicPreluCases, ActivationLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(smoke_Activation_Basic, ActivationParamLayerTest, basicPreluCases, ActivationLayerTest::getTestCaseName);