[IE][VPU]: Enabling of NonZero single layer tests (#1502)
This commit is contained in:
parent
531a7209d5
commit
00630127e7
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "single_layer_tests/nonzero.hpp"
|
#include "single_layer_tests/nonzero.hpp"
|
||||||
|
|
||||||
#include "common_test_utils/test_constants.hpp"
|
#include "common/myriad_common_test_utils.hpp"
|
||||||
#include <vpu/vpu_plugin_config.hpp>
|
#include <vpu/vpu_plugin_config.hpp>
|
||||||
#include <vpu/private_plugin_config.hpp>
|
#include <vpu/private_plugin_config.hpp>
|
||||||
|
|
||||||
@ -16,10 +16,21 @@ using namespace LayerTestsDefinitions;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
ConfigMap getConfig() {
|
||||||
|
ConfigMap config;
|
||||||
|
config[VPU_CONFIG_KEY(DETECT_NETWORK_BATCH)] = CONFIG_VALUE(NO);
|
||||||
|
if (CommonTestUtils::vpu::CheckMyriad2()) {
|
||||||
|
config[VPU_CONFIG_KEY(DISABLE_REORDER)] = CONFIG_VALUE(YES);
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::vector<size_t>> inShapes = {
|
std::vector<std::vector<size_t>> inShapes = {
|
||||||
{1000},
|
{1000},
|
||||||
{4, 1000},
|
{4, 1000},
|
||||||
{2, 4, 1000},
|
{2, 4, 1000},
|
||||||
|
{2, 4, 4, 1000},
|
||||||
|
{2, 4, 4, 2, 1000},
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<InferenceEngine::Precision> inputPrecisions = {
|
const std::vector<InferenceEngine::Precision> inputPrecisions = {
|
||||||
@ -28,11 +39,12 @@ const std::vector<InferenceEngine::Precision> inputPrecisions = {
|
|||||||
InferenceEngine::Precision::U8,
|
InferenceEngine::Precision::U8,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Enable this when #-29056 is ready
|
INSTANTIATE_TEST_CASE_P(nonzero, NonZeroLayerTest,
|
||||||
INSTANTIATE_TEST_CASE_P(DISABLED_nonzero, NonZeroLayerTest,
|
|
||||||
::testing::Combine(
|
::testing::Combine(
|
||||||
::testing::ValuesIn(inShapes),
|
::testing::ValuesIn(inShapes),
|
||||||
::testing::ValuesIn(inputPrecisions),
|
::testing::ValuesIn(inputPrecisions),
|
||||||
::testing::Values(CommonTestUtils::DEVICE_MYRIAD)),
|
::testing::Values(CommonTestUtils::DEVICE_MYRIAD),
|
||||||
NonZeroLayerTest::getTestCaseName);
|
::testing::Values(getConfig())),
|
||||||
|
NonZeroLayerTest::getTestCaseName);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -22,7 +22,8 @@ using ConfigMap = typename std::map<std::string, std::string>;
|
|||||||
using NonZeroLayerTestParamsSet = typename std::tuple<
|
using NonZeroLayerTestParamsSet = typename std::tuple<
|
||||||
InferenceEngine::SizeVector, // Input shapes
|
InferenceEngine::SizeVector, // Input shapes
|
||||||
InferenceEngine::Precision, // Input precision
|
InferenceEngine::Precision, // Input precision
|
||||||
LayerTestsUtils::TargetDevice>; // Device name
|
LayerTestsUtils::TargetDevice, // Device name
|
||||||
|
ConfigMap>; // Additional network configuration
|
||||||
|
|
||||||
class NonZeroLayerTest : public testing::WithParamInterface<NonZeroLayerTestParamsSet>,
|
class NonZeroLayerTest : public testing::WithParamInterface<NonZeroLayerTestParamsSet>,
|
||||||
public LayerTestsUtils::LayerTestsCommon {
|
public LayerTestsUtils::LayerTestsCommon {
|
||||||
|
@ -22,7 +22,8 @@ std::string NonZeroLayerTest::getTestCaseName(testing::TestParamInfo<NonZeroLaye
|
|||||||
std::vector<size_t> inputShape;
|
std::vector<size_t> inputShape;
|
||||||
InferenceEngine::Precision inputPrecision;
|
InferenceEngine::Precision inputPrecision;
|
||||||
std::string targetDevice;
|
std::string targetDevice;
|
||||||
std::tie(inputShape, inputPrecision, targetDevice) = obj.param;
|
ConfigMap additionalConfig;
|
||||||
|
std::tie(inputShape, inputPrecision, targetDevice, additionalConfig) = obj.param;
|
||||||
|
|
||||||
std::ostringstream result;
|
std::ostringstream result;
|
||||||
result << "IS=" << CommonTestUtils::vec2str(inputShape) << "_";
|
result << "IS=" << CommonTestUtils::vec2str(inputShape) << "_";
|
||||||
@ -35,7 +36,10 @@ void NonZeroLayerTest::SetUp() {
|
|||||||
SetRefMode(LayerTestsUtils::RefMode::CONSTANT_FOLDING);
|
SetRefMode(LayerTestsUtils::RefMode::CONSTANT_FOLDING);
|
||||||
auto inputShape = std::vector<std::size_t>{};
|
auto inputShape = std::vector<std::size_t>{};
|
||||||
auto inputPrecision = InferenceEngine::Precision::UNSPECIFIED;
|
auto inputPrecision = InferenceEngine::Precision::UNSPECIFIED;
|
||||||
std::tie(inputShape, inputPrecision, targetDevice) = GetParam();
|
ConfigMap additionalConfig;
|
||||||
|
std::tie(inputShape, inputPrecision, targetDevice, additionalConfig) = GetParam();
|
||||||
|
|
||||||
|
configuration.insert(additionalConfig.cbegin(), additionalConfig.cend());
|
||||||
|
|
||||||
const auto& precision = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inputPrecision);
|
const auto& precision = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inputPrecision);
|
||||||
const auto& paramNode = std::make_shared<ngraph::opset1::Parameter>(precision, ngraph::Shape(inputShape));
|
const auto& paramNode = std::make_shared<ngraph::opset1::Parameter>(precision, ngraph::Shape(inputShape));
|
||||||
|
Loading…
Reference in New Issue
Block a user