Skip to content

Commit

Permalink
Review comments implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagiers committed Jun 1, 2020
1 parent beb36da commit 421f83d
Show file tree
Hide file tree
Showing 13 changed files with 202 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ using namespace LayerTestsDefinitions;
using namespace AddTestDefinitions;
namespace {

std::vector<std::vector<std::vector<size_t>>> inputShapes = { {std::vector<std::size_t>({1, 30})} };
std::vector<std::vector<std::vector<size_t>>> inputShapes = { {{1, 200}},
{{1, 2000}},
{{1, 20000}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
};

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,37 @@ using namespace LayerTestsDefinitions;
using namespace SubtractTestDefinitions;
namespace {

std::vector<std::vector<std::vector<size_t>>> inputShapes = { {std::vector<std::size_t>({1, 30})} };

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
std::vector<std::vector<std::vector<size_t>>> inputShapes = { {{1, 200}},
{{1, 2000}},
{{1, 20000}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
};

std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};

std::map<std::string, std::string> additional_config = {};

const auto subtraction_params_vector_fp32 = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

const auto subtraction_params_vector_fp16_parameter = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::Values(SecondaryInputType::PARAMETER),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

const auto subtraction_params_vector_fp16_constant = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::Values(SecondaryInputType::CONSTANT),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));
std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

const auto subtraction_params_scalar = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(SubtractionType::SCALAR),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));
std::vector<SubtractionType> subtractionTypes = { SubtractionType::SCALAR,
SubtractionType::VECTOR,
};

INSTANTIATE_TEST_CASE_P(CompareWithRefs_vector_fp32, SubtractLayerTest,
subtraction_params_vector_fp32, SubtractLayerTest::getTestCaseName);
std::map<std::string, std::string> additional_config = {};

INSTANTIATE_TEST_CASE_P(CompareWithRefs_vector_fp16_parameter, SubtractLayerTest,
subtraction_params_vector_fp16_parameter, SubtractLayerTest::getTestCaseName);
const auto subtraction_params = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(subtractionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_vector_fp16_constant, SubtractLayerTest,
subtraction_params_vector_fp16_constant, SubtractLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(CompareWithRefs, SubtractLayerTest, subtraction_params, SubtractLayerTest::getTestCaseName);

INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_scalar, SubtractLayerTest,
subtraction_params_scalar, SubtractLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ std::vector<std::string> disabledTestPatterns() {
// TODO: Issue 32023
R"(.*(QuantGroupConvBackpropData2D)*QG=Pertensor.*)",
// TODO: Issue 31845
R"(.*(FakeQuantize).*)"
R"(.*(FakeQuantize).*)",
// TODO: Issue 32521
R"(.*SubtractLayerTest.*netPRC=FP16.*)"
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ using namespace LayerTestsDefinitions;
using namespace AddTestDefinitions;
namespace {

std::vector<std::vector<std::vector<size_t>>> inputShapes = { {std::vector<std::size_t>({1, 30})} };
std::vector<std::vector<InferenceEngine::SizeVector>> flat_shapes = { {{1, 200}}, {{1, 2000}}, {{1, 20000}} };
std::vector<std::vector<InferenceEngine::SizeVector>> non_flat_shapes = { {{2, 200}}, {{10, 200}}, {{1, 10, 100}}, {{4, 4, 16}} };

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<AdditionType> additionTypes = { AdditionType::SCALAR,
AdditionType::VECTOR,
};

std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};
Expand All @@ -29,23 +34,22 @@ std::map<std::string, std::string> additional_config = {
{"GNA_SCALE_FACTOR_1", "1638.4"}
};

const auto addition_params_scalar = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(AdditionType::SCALAR),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto addition_params_vector = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(AdditionType::VECTOR),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));


INSTANTIATE_TEST_CASE_P(CompareWithRefs_vector, AddLayerTest, addition_params_vector, AddLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_scalar, AddLayerTest, addition_params_scalar, AddLayerTest::getTestCaseName);
const auto addition_params_flat= ::testing::Combine(
::testing::ValuesIn(flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(additionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto addition_params_non_flat = ::testing::Combine(
::testing::ValuesIn(non_flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(additionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs_flat, AddLayerTest, addition_params_flat, AddLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(CompareWithRefs_non_flat, AddLayerTest, addition_params_non_flat, AddLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using namespace MultiplyTestDefinitions;

namespace {
std::vector<std::vector<std::vector<size_t>>> inShapes = {
{{1,200}},
{{2}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
Expand All @@ -24,6 +25,10 @@ std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Preci
InferenceEngine::Precision::FP16,
};

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<MultiplicationType> multiplicationTypes = { MultiplicationType::SCALAR,
MultiplicationType::VECTOR,
};
Expand All @@ -34,22 +39,13 @@ std::map<std::string, std::string> additional_config = {
{"GNA_SCALE_FACTOR_1", "1638.4"}
};

const auto multiply_params_constant = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::Values(SecondaryInputType::CONSTANT),
::testing::ValuesIn(multiplicationTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto multiply_params_parameter = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::Values(SecondaryInputType::PARAMETER),
::testing::ValuesIn(multiplicationTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs_constant, MultiplyLayerTest, multiply_params_constant, MultiplyLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_parameter, MultiplyLayerTest, multiply_params_parameter, MultiplyLayerTest::getTestCaseName);
const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(multiplicationTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs, MultiplyLayerTest, multiply_params, MultiplyLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ using namespace LayerTestsDefinitions;
using namespace SubtractTestDefinitions;
namespace {

std::vector<std::vector<std::vector<size_t>>> inputShapes = { {std::vector<std::size_t>({1, 30})} };
std::vector<std::vector<InferenceEngine::SizeVector>> flat_shapes = { {{1, 200}}, {{1, 2000}}, {{1, 20000}} };
std::vector<std::vector<InferenceEngine::SizeVector>> non_flat_shapes = { {{2, 200}}, {{10, 200}}, {{1, 10, 100}}, {{4, 4, 16}} };

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<SubtractionType> substractionTypes = { SubtractionType::SCALAR,
SubtractionType::VECTOR,
};

std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};
Expand All @@ -29,47 +34,24 @@ std::map<std::string, std::string> additional_config = {
{"GNA_SCALE_FACTOR_1", "1638.4"}
};

const auto subtraction_params_vector_fp32 = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP32),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto subtraction_params_vector_fp16_parameter = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::Values(SecondaryInputType::PARAMETER),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto subtraction_params_vector_fp16_constant = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::Values(SecondaryInputType::CONSTANT),
::testing::Values(SubtractionType::VECTOR),
::testing::Values(InferenceEngine::Precision::FP16),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto subtraction_params_scalar = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::Values(SubtractionType::SCALAR),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));
const auto subtraction_params_flat = ::testing::Combine(
::testing::ValuesIn(flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(substractionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs_vector_fp32, SubtractLayerTest,
subtraction_params_vector_fp32, SubtractLayerTest::getTestCaseName);
const auto subtraction_params_non_flat = ::testing::Combine(
::testing::ValuesIn(non_flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(substractionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs_vector_fp16_parameter, SubtractLayerTest,
subtraction_params_vector_fp16_parameter, SubtractLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(CompareWithRefs_flat, SubtractLayerTest, subtraction_params_flat, SubtractLayerTest::getTestCaseName);

INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_vector_fp16_constant, SubtractLayerTest,
subtraction_params_vector_fp16_constant, SubtractLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(CompareWithRefs_non_flat, SubtractLayerTest, subtraction_params_non_flat, SubtractLayerTest::getTestCaseName);

INSTANTIATE_TEST_CASE_P(DISABLED_CompareWithRefs_scalar, SubtractLayerTest,
subtraction_params_scalar, SubtractLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ std::vector<std::string> disabledTestPatterns() {
return {
// TODO: FIX BUG 31661
".*Behavior.*CallbackThrowException.*"
".*Behavior.*Callback.*",
// TODO: Issue 32541
".*MultiplyLayerTest.*secondaryInputType=PARAMETER.*",
// TODO: Issue 32544
".*non_flat.*(Add|Subtract)LayerTest.*",
// TODO: Issue 32542
".*(Add|Subtract)LayerTest.*Type=SCALAR.*",
// TODO: Issue 32521
".*SubtractLayerTest.*netPRC=FP16.*"
};
}
Loading

0 comments on commit 421f83d

Please sign in to comment.