return in, out, prc

This commit is contained in:
Efode, Irina committed 2021-10-21 11:22:42 +03:00
1 parent 5a492efa3b
commit 2ee8c92df6
15 files changed
+84 -11

No files matched your search

@@ -79,6 +79,8 @@ const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config));
@@ -88,6 +90,8 @@ const auto multiply_params_dynamic = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypesDynamic),
::testing::ValuesIn(opTypesDynamic),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config));
@@ -116,6 +120,8 @@ const auto single_thread_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::Values(additional_config_single_thread));
@@ -35,6 +35,8 @@ const std::vector<size_t> axis2D = {
const auto params2D_static = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputStaticShape2D)),
testing::ValuesIn(axis2D),
testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
@@ -43,6 +45,8 @@ const auto params2D_static = testing::Combine(
const auto params2D_dynamic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(inputDynamicShape2D),
testing::ValuesIn(axis2D),
testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
@@ -79,6 +83,8 @@ const std::vector<size_t> axis4D = {0, 1, 2, 3};
const auto params4Dstatic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputStaticShape4D)),
testing::ValuesIn(axis4D),
testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
@@ -87,6 +93,8 @@ const auto params4Dstatic = testing::Combine(
const auto params4Ddynamic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(inputDynamicShape4D),
testing::ValuesIn(axis4D),
testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
@@ -59,6 +59,8 @@ const auto elementiwiseParams = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(inputPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additionalConfig));
@@ -68,6 +70,8 @@ const auto elementiwiseParamsDyn = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(inputPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additionalConfig));
@@ -79,6 +79,8 @@ const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));
@@ -88,6 +90,8 @@ const auto multiply_params_dynamic = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypesDynamic),
::testing::ValuesIn(opTypesDynamic),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));
@@ -116,6 +120,8 @@ const auto single_thread_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config_single_thread));
@@ -34,6 +34,8 @@ const std::vector<size_t> axis2D = {
const auto params2D_static = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation({inputStaticShape2D})),
testing::ValuesIn(axis2D),
testing::Values(CommonTestUtils::DEVICE_CPU),
@@ -42,6 +44,8 @@ const auto params2D_static = testing::Combine(
const auto params2D_dynamic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(inputDynamicShape2D),
testing::ValuesIn(axis2D),
testing::Values(CommonTestUtils::DEVICE_CPU),
@@ -78,6 +82,8 @@ const std::vector<size_t> axis4D = {0, 1, 2, 3};
const auto params4Dstatic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation({inputStaticShape4D})),
testing::ValuesIn(axis4D),
testing::Values(CommonTestUtils::DEVICE_CPU),
@@ -86,6 +92,8 @@ const auto params4Dstatic = testing::Combine(
const auto params4Ddynamic = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(inputDynamicShape4D),
testing::ValuesIn(axis4D),
testing::Values(CommonTestUtils::DEVICE_CPU),
@@ -53,6 +53,8 @@ const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));
@@ -60,6 +60,8 @@ const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(additional_config));
@@ -27,6 +27,8 @@ const std::vector<size_t> axis2D = {
const auto params2D = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes2D)),
testing::ValuesIn(axis2D),
testing::Values(CommonTestUtils::DEVICE_GPU),
@@ -50,6 +52,8 @@ const std::vector<size_t> axis4D = {0, 1, 2, 3};
const auto params4D = testing::Combine(
testing::ValuesIn(netPrecisions),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
testing::ValuesIn(ov::test::static_shapes_to_test_representation(inputShapes4D)),
testing::ValuesIn(axis4D),
testing::Values(CommonTestUtils::DEVICE_GPU),
@@ -63,6 +63,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_EltwiseMathFP,
::testing::Values(ngraph::helpers::InputLayerType::PARAMETER),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(fpTypes),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})),
EltwiseLayerTest::getTestCaseName);
@@ -75,6 +77,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_EltwiseMathInt,
::testing::Values(ngraph::helpers::InputLayerType::PARAMETER),
::testing::ValuesIn(opTypes),
::testing::ValuesIn(intTypes),
::testing::Values(ov::element::undefined),
::testing::Values(ov::element::undefined),
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
::testing::Values(Config{{InferenceEngine::MYRIAD_DETECT_NETWORK_BATCH, CONFIG_VALUE(NO)}})),
EltwiseLayerTest::getTestCaseName);
@@ -50,6 +50,7 @@ protected:
std::map<std::string, ov::runtime::Tensor> inputs;
std::vector<ngraph::PartialShape> inputDynamicShapes;
std::vector<std::vector<ngraph::Shape>> targetStaticShapes;
ElementType inType = ov::element::undefined, outType = ov::element::undefined;
ov::runtime::ExecutableNetwork executableNetwork;
ov::runtime::InferRequest inferRequest;
@@ -17,6 +17,8 @@ typedef std::tuple<
ngraph::helpers::InputLayerType, // secondary input type
CommonTestUtils::OpType, // op type
ElementType, // Net precision
ElementType, // In precision
ElementType, // Out precision
TargetDevice, // Device name
Config // Additional network configuration
> EltwiseTestParams;
@@ -12,6 +12,8 @@ namespace subgraph {
using SoftMaxTestParams = std::tuple<
ElementType, // netPrecision
ElementType, // inPrecision
ElementType, // outPrecision
InputShape, // Dynamic shape + Target static shapes
size_t, // axis
TargetDevice, // targetDevice
@@ -46,7 +46,7 @@ void SubgraphBaseTest::run() {
try {
compile_model();
for (const auto& targetStaticShapeVec : targetStaticShapes) {
// try {
try {
if (!inputDynamicShapes.empty()) {
// resize ngraph function according new target shape
ngraph::helpers::resize_function(functionRefs, targetStaticShapeVec);
@@ -54,9 +54,9 @@ void SubgraphBaseTest::run() {
generate_inputs(targetStaticShapeVec);
infer();
validate();
// } catch (const std::exception &ex) {
// throw std::runtime_error("Incorrect target static shape: " + CommonTestUtils::vec2str(targetStaticShapeVec) + " " + ex.what());
// }
} catch (const std::exception &ex) {
throw std::runtime_error("Incorrect target static shape: " + CommonTestUtils::vec2str(targetStaticShapeVec) + " " + ex.what());
}
}
status = LayerTestsUtils::PassRate::Statuses::PASSED;
} catch (const std::exception &ex) {
@@ -123,7 +123,27 @@ void SubgraphBaseTest::compare(const std::vector<ov::runtime::Tensor> &expected,
}
}
void SubgraphBaseTest::configure_model() {}
void SubgraphBaseTest::configure_model() {
// configure input precision
{
auto params = function->get_parameters();
for (auto& param : params) {
if (inType != ov::element::Type_t::undefined) {
param->get_output_tensor(0).set_element_type(inType);
}
}
}
// configure output precision
{
auto results = function->get_results();
for (auto& result : results) {
if (outType != ov::element::Type_t::undefined) {
result->get_output_tensor(0).set_element_type(outType);
}
}
}
}
void SubgraphBaseTest::compile_model() {
configure_model();
@@ -12,13 +12,13 @@ namespace subgraph {
std::string EltwiseLayerTest::getTestCaseName(const testing::TestParamInfo<EltwiseTestParams>& obj) {
std::vector<InputShape> shapes;
ElementType netType;
ElementType netType, inType, outType;
ngraph::helpers::InputLayerType secondaryInputType;
CommonTestUtils::OpType opType;
ngraph::helpers::EltwiseTypes eltwiseOpType;
std::string targetName;
std::map<std::string, std::string> additional_config;
std::tie(shapes, eltwiseOpType, secondaryInputType, opType, netType, targetName, additional_config) = obj.param;
std::tie(shapes, eltwiseOpType, secondaryInputType, opType, netType, inType, outType, targetName, additional_config) = obj.param;
std::ostringstream results;
results << "IS=(";
@@ -35,6 +35,8 @@ std::string EltwiseLayerTest::getTestCaseName(const testing::TestParamInfo<Eltwi
results << "secondaryInputType=" << secondaryInputType << "_";
results << "opType=" << opType << "_";
results << "NetType=" << netType << "_";
results << "InType=" << inType << "_";
results << "OutType=" << outType << "_";
results << "trgDev=" << targetName;
return results.str();
}
@@ -98,7 +100,7 @@ void EltwiseLayerTest::SetUp() {
CommonTestUtils::OpType opType;
ngraph::helpers::EltwiseTypes eltwiseType;
Config additional_config;
std::tie(shapes, eltwiseType, secondaryInputType, opType, netType, targetDevice, configuration) =
std::tie(shapes, eltwiseType, secondaryInputType, opType, netType, inType, outType, targetDevice, configuration) =
this->GetParam();
init_input_shapes(shapes);
@@ -13,15 +13,17 @@ namespace test {
namespace subgraph {
std::string SoftMaxLayerTest::getTestCaseName(const testing::TestParamInfo<SoftMaxTestParams>& obj) {
ElementType netType;
ElementType netType, inType, outType;
InputShape shapes;
size_t axis;
TargetDevice targetDevice;
Config config;
std::tie(netType, shapes, axis, targetDevice, config) = obj.param;
std::tie(netType, inType, outType, shapes, axis, targetDevice, config) = obj.param;
std::ostringstream result;
result << "NetType=" << netType << "_";
result << "InType=" << inType << "_";
result << "OutType=" << outType << "_";
result << "IS=" << CommonTestUtils::partialShape2str({shapes.first}) << "_";
result << "TS=";
for (const auto& item : shapes.second) {
@@ -38,7 +40,7 @@ void SoftMaxLayerTest::SetUp() {
ElementType ngPrc;
size_t axis;
std::tie(ngPrc, shapes, axis, targetDevice, configuration) = GetParam();
std::tie(ngPrc, inType, outType, shapes, axis, targetDevice, configuration) = GetParam();
init_input_shapes({shapes});
const auto params = ngraph::builder::makeDynamicParams(ngPrc, inputDynamicShapes);