Allow the framework to generate input data without infer request object (#4117)
This commit is contained in:
parent
7e57ec54b3
commit
6c522fe76b
@ -53,6 +53,7 @@ public:
|
|||||||
|
|
||||||
configuration.insert(exportConfiguration.begin(), exportConfiguration.end());
|
configuration.insert(exportConfiguration.begin(), exportConfiguration.end());
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
executableNetwork.Export("exported_model.blob");
|
executableNetwork.Export("exported_model.blob");
|
||||||
for (auto const &configItem : importConfiguration) {
|
for (auto const &configItem : importConfiguration) {
|
||||||
|
@ -20,6 +20,7 @@ TEST_P(FakeQuantizeLayerTest, CompareWithRefs) {
|
|||||||
size_t nIterations = 1;
|
size_t nIterations = 1;
|
||||||
for (; nIterations != 0; nIterations--) {
|
for (; nIterations != 0; nIterations--) {
|
||||||
UpdateSeed();
|
UpdateSeed();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
Validate();
|
Validate();
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ TEST_P(StaticShapeLoopTest, CompareWithRefs) {
|
|||||||
TEST_P(StaticShapeLoopTest, CompareWithPredefinedRefs) {
|
TEST_P(StaticShapeLoopTest, CompareWithPredefinedRefs) {
|
||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
auto expectedOutputs = PredefinedRefs(); // use predefined refs instead of CalculateRefs function
|
auto expectedOutputs = PredefinedRefs(); // use predefined refs instead of CalculateRefs function
|
||||||
const auto& actualOutputs = GetOutputs();
|
const auto& actualOutputs = GetOutputs();
|
||||||
|
@ -56,6 +56,7 @@ TEST_P(Basic_LSTM_S, CompareWithRefImpl_LowLatencyTransformation) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
// Run and compare
|
// Run and compare
|
||||||
Infer();
|
Infer();
|
||||||
const auto& actualOutputs = GetOutputs();
|
const auto& actualOutputs = GetOutputs();
|
||||||
|
@ -10,6 +10,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
|
|
||||||
TEST_P(EltwiseAfterConvTest, CompareWithRefImpl) {
|
TEST_P(EltwiseAfterConvTest, CompareWithRefImpl) {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
// Create another copy of function for validation since some data will be changed by GNA plugin
|
// Create another copy of function for validation since some data will be changed by GNA plugin
|
||||||
SetUp();
|
SetUp();
|
||||||
@ -18,6 +19,7 @@ TEST_P(EltwiseAfterConvTest, CompareWithRefImpl) {
|
|||||||
|
|
||||||
TEST_P(EltwiseBeforeConvTest, CompareWithRefImpl) {
|
TEST_P(EltwiseBeforeConvTest, CompareWithRefImpl) {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
// Create another copy of function for validation since some data will be changed by GNA plugin
|
// Create another copy of function for validation since some data will be changed by GNA plugin
|
||||||
SetUp();
|
SetUp();
|
||||||
|
@ -10,6 +10,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
|
|
||||||
TEST_P(ScaleShiftAfterConvTest, CompareWithRefImpl) {
|
TEST_P(ScaleShiftAfterConvTest, CompareWithRefImpl) {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
// Create another copy of function for validation since some data will be changed by GNA plugin
|
// Create another copy of function for validation since some data will be changed by GNA plugin
|
||||||
SetUp();
|
SetUp();
|
||||||
@ -18,6 +19,7 @@ TEST_P(ScaleShiftAfterConvTest, CompareWithRefImpl) {
|
|||||||
|
|
||||||
TEST_P(ScaleShiftBeforeConvTest, CompareWithRefImpl) {
|
TEST_P(ScaleShiftBeforeConvTest, CompareWithRefImpl) {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
// Create another copy of function for validation since some data will be changed by GNA plugin
|
// Create another copy of function for validation since some data will be changed by GNA plugin
|
||||||
SetUp();
|
SetUp();
|
||||||
|
@ -38,6 +38,7 @@ void ImportNetworkTestBase::Run() {
|
|||||||
|
|
||||||
configuration.insert(exportConfiguration.begin(), exportConfiguration.end());
|
configuration.insert(exportConfiguration.begin(), exportConfiguration.end());
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
const auto& actualOutputs = GetOutputs();
|
const auto& actualOutputs = GetOutputs();
|
||||||
@ -52,6 +53,7 @@ void ImportNetworkTestBase::Run() {
|
|||||||
exportImportNetwork();
|
exportImportNetwork();
|
||||||
const auto importedExecNetwork = executableNetwork;
|
const auto importedExecNetwork = executableNetwork;
|
||||||
|
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
ASSERT_EQ(importedExecNetwork.GetInputsInfo().size(), compiledExecNetwork.GetInputsInfo().size());
|
ASSERT_EQ(importedExecNetwork.GetInputsInfo().size(), compiledExecNetwork.GetInputsInfo().size());
|
||||||
|
@ -95,6 +95,7 @@ void ProposalBehTest::SetUp() {
|
|||||||
|
|
||||||
void ProposalBehTest::Run() {
|
void ProposalBehTest::Run() {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ void SetBlobOfKindTest::Run() {
|
|||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||||
|
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
|
|
||||||
if (isBlobKindSupported(core, targetDevice, blobKind)) {
|
if (isBlobKindSupported(core, targetDevice, blobKind)) {
|
||||||
Infer();
|
Infer();
|
||||||
|
@ -43,6 +43,7 @@ TEST_P(MultipleAllocations, InferWorksCorrectAfterAllocations) {
|
|||||||
|
|
||||||
std::cout << "Infer(): " << j << std::flush;
|
std::cout << "Infer(): " << j << std::flush;
|
||||||
|
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
Validate();
|
Validate();
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,7 @@ namespace ConfigurationTestsDefinitions {
|
|||||||
void DynamicBatchTest::Run() {
|
void DynamicBatchTest::Run() {
|
||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED();
|
SKIP_IF_CURRENT_TEST_IS_DISABLED();
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
Validate();
|
Validate();
|
||||||
}
|
}
|
||||||
|
@ -189,6 +189,8 @@ protected:
|
|||||||
|
|
||||||
void LoadNetwork();
|
void LoadNetwork();
|
||||||
|
|
||||||
|
virtual void GenerateInputs();
|
||||||
|
|
||||||
virtual void Infer();
|
virtual void Infer();
|
||||||
|
|
||||||
TargetDevice targetDevice;
|
TargetDevice targetDevice;
|
||||||
|
@ -62,7 +62,7 @@ class DetectionOutputLayerTest : public testing::WithParamInterface<DetectionOut
|
|||||||
static std::string getTestCaseName(testing::TestParamInfo<DetectionOutputParams> obj);
|
static std::string getTestCaseName(testing::TestParamInfo<DetectionOutputParams> obj);
|
||||||
ngraph::op::DetectionOutputAttrs attrs;
|
ngraph::op::DetectionOutputAttrs attrs;
|
||||||
std::vector<InferenceEngine::SizeVector> inShapes;
|
std::vector<InferenceEngine::SizeVector> inShapes;
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
void Compare(const std::vector<std::uint8_t> &expected, const InferenceEngine::Blob::Ptr &actual) override;
|
void Compare(const std::vector<std::uint8_t> &expected, const InferenceEngine::Blob::Ptr &actual) override;
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ngraph::helpers::SequenceTestsMode m_mode;
|
ngraph::helpers::SequenceTestsMode m_mode;
|
||||||
|
@ -32,7 +32,7 @@ class LSTMSequenceTest : public testing::WithParamInterface<LSTMSequenceParams>,
|
|||||||
public:
|
public:
|
||||||
static std::string getTestCaseName(const testing::TestParamInfo<LSTMSequenceParams> &obj);
|
static std::string getTestCaseName(const testing::TestParamInfo<LSTMSequenceParams> &obj);
|
||||||
protected:
|
protected:
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -34,7 +34,7 @@ using NmsParams = std::tuple<InputShapeParams,
|
|||||||
class NmsLayerTest : public testing::WithParamInterface<NmsParams>, virtual public LayerTestsUtils::LayerTestsCommon {
|
class NmsLayerTest : public testing::WithParamInterface<NmsParams>, virtual public LayerTestsUtils::LayerTestsCommon {
|
||||||
public:
|
public:
|
||||||
static std::string getTestCaseName(testing::TestParamInfo<NmsParams> obj);
|
static std::string getTestCaseName(testing::TestParamInfo<NmsParams> obj);
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
void Compare(const std::vector<std::vector<std::uint8_t>> &expectedOutputs, const std::vector<InferenceEngine::Blob::Ptr> &actualOutputs) override;
|
void Compare(const std::vector<std::vector<std::uint8_t>> &expectedOutputs, const std::vector<InferenceEngine::Blob::Ptr> &actualOutputs) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -32,7 +32,7 @@ class PSROIPoolingLayerTest : public testing::WithParamInterface<psroiParams>,
|
|||||||
virtual public LayerTestsUtils::LayerTestsCommon {
|
virtual public LayerTestsUtils::LayerTestsCommon {
|
||||||
public:
|
public:
|
||||||
static std::string getTestCaseName(testing::TestParamInfo<psroiParams> obj);
|
static std::string getTestCaseName(testing::TestParamInfo<psroiParams> obj);
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ngraph::helpers::SequenceTestsMode m_mode;
|
ngraph::helpers::SequenceTestsMode m_mode;
|
||||||
|
@ -23,7 +23,6 @@ class ROIAlignLayerTest : public testing::WithParamInterface<roialignParams>,
|
|||||||
virtual public LayerTestsUtils::LayerTestsCommon {
|
virtual public LayerTestsUtils::LayerTestsCommon {
|
||||||
public:
|
public:
|
||||||
static std::string getTestCaseName(testing::TestParamInfo<roialignParams> obj);
|
static std::string getTestCaseName(testing::TestParamInfo<roialignParams> obj);
|
||||||
void Infer() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
|
@ -30,7 +30,7 @@ class ROIPoolingLayerTest : public testing::WithParamInterface<roiPoolingParamsT
|
|||||||
virtual public LayerTestsUtils::LayerTestsCommon {
|
virtual public LayerTestsUtils::LayerTestsCommon {
|
||||||
public:
|
public:
|
||||||
static std::string getTestCaseName(testing::TestParamInfo<roiPoolingParamsTuple> obj);
|
static std::string getTestCaseName(testing::TestParamInfo<roiPoolingParamsTuple> obj);
|
||||||
void Infer() override;
|
void GenerateInputs() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
|
@ -178,6 +178,7 @@ void LayerTestsCommon::Run() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
Validate();
|
Validate();
|
||||||
reportStatus(PassRate::Statuses::PASSED);
|
reportStatus(PassRate::Statuses::PASSED);
|
||||||
@ -336,20 +337,34 @@ void LayerTestsCommon::LoadNetwork() {
|
|||||||
executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice, configuration);
|
executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice, configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerTestsCommon::Infer() {
|
void LayerTestsCommon::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
const auto& inputsInfo = executableNetwork.GetInputsInfo();
|
const auto& inputsInfo = executableNetwork.GetInputsInfo();
|
||||||
for (const auto& param : function->get_parameters()) {
|
const auto& functionParams = function->get_parameters();
|
||||||
|
for (int i = 0; i < functionParams.size(); ++i) {
|
||||||
|
const auto& param = functionParams[i];
|
||||||
const auto infoIt = inputsInfo.find(param->get_friendly_name());
|
const auto infoIt = inputsInfo.find(param->get_friendly_name());
|
||||||
GTEST_ASSERT_NE(infoIt, inputsInfo.cend());
|
GTEST_ASSERT_NE(infoIt, inputsInfo.cend());
|
||||||
|
|
||||||
const auto& info = infoIt->second;
|
const auto& info = infoIt->second;
|
||||||
auto blob = GenerateInput(*info);
|
auto blob = GenerateInput(*info);
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerTestsCommon::Infer() {
|
||||||
|
inferRequest = executableNetwork.CreateInferRequest();
|
||||||
|
|
||||||
|
const auto& inputsInfo = executableNetwork.GetInputsInfo();
|
||||||
|
const auto& functionParams = function->get_parameters();
|
||||||
|
for (int i = 0; i < functionParams.size(); ++i) {
|
||||||
|
const auto& param = functionParams[i];
|
||||||
|
const auto infoIt = inputsInfo.find(param->get_friendly_name());
|
||||||
|
GTEST_ASSERT_NE(infoIt, inputsInfo.cend());
|
||||||
|
|
||||||
|
const auto& info = infoIt->second;
|
||||||
|
auto blob = inputs[i];
|
||||||
|
inferRequest.SetBlob(info->name(), blob);
|
||||||
|
}
|
||||||
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) &&
|
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) &&
|
||||||
configuration.count(InferenceEngine::PluginConfigParams::YES)) {
|
configuration.count(InferenceEngine::PluginConfigParams::YES)) {
|
||||||
auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
|
auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
|
||||||
|
@ -184,7 +184,7 @@ void ActivationParamLayerTest::generateActivationBlob(std::vector<float> constan
|
|||||||
|
|
||||||
void ActivationParamLayerTest::Infer() {
|
void ActivationParamLayerTest::Infer() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
inferRequest = executableNetwork.CreateInferRequest();
|
||||||
inputs.clear();
|
|
||||||
auto blobInput = inferRequest.GetBlob("Input");
|
auto blobInput = inferRequest.GetBlob("Input");
|
||||||
blobInput = FuncTestUtils::createAndFillBlobFloat(blobInput->getTensorDesc());
|
blobInput = FuncTestUtils::createAndFillBlobFloat(blobInput->getTensorDesc());
|
||||||
|
|
||||||
|
@ -64,10 +64,7 @@ std::string DetectionOutputLayerTest::getTestCaseName(testing::TestParamInfo<Det
|
|||||||
return result.str();
|
return result.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectionOutputLayerTest::Infer() {
|
void DetectionOutputLayerTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
size_t it = 0;
|
size_t it = 0;
|
||||||
for (const auto &input : cnnNetwork.getInputsInfo()) {
|
for (const auto &input : cnnNetwork.getInputsInfo()) {
|
||||||
const auto &info = input.second;
|
const auto &info = input.second;
|
||||||
@ -88,11 +85,9 @@ void DetectionOutputLayerTest::Infer() {
|
|||||||
blob = make_blob_with_precision(info->getTensorDesc());
|
blob = make_blob_with_precision(info->getTensorDesc());
|
||||||
blob->allocate();
|
blob->allocate();
|
||||||
CommonTestUtils::fill_data_random_float<InferenceEngine::Precision::FP32>(blob, range, 0, resolution);
|
CommonTestUtils::fill_data_random_float<InferenceEngine::Precision::FP32>(blob, range, 0, resolution);
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectionOutputLayerTest::Compare(const std::vector<std::uint8_t> &expected, const InferenceEngine::Blob::Ptr &actual) {
|
void DetectionOutputLayerTest::Compare(const std::vector<std::uint8_t> &expected, const InferenceEngine::Blob::Ptr &actual) {
|
||||||
|
@ -93,25 +93,14 @@ namespace LayerTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRUSequenceTest::Infer() {
|
void GRUSequenceTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
||||||
const auto &info = input.second;
|
const auto &info = input.second;
|
||||||
auto blob = GenerateInput(*info);
|
auto blob = GenerateInput(*info);
|
||||||
if (input.first == "seq_lengths") {
|
if (input.first == "seq_lengths") {
|
||||||
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
}
|
}
|
||||||
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) &&
|
|
||||||
configuration.count(InferenceEngine::PluginConfigParams::YES)) {
|
|
||||||
auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
|
|
||||||
inferRequest.SetBatch(batchSize);
|
|
||||||
}
|
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
} // namespace LayerTestsDefinitions
|
} // namespace LayerTestsDefinitions
|
||||||
|
@ -93,10 +93,7 @@ namespace LayerTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LSTMSequenceTest::Infer() {
|
void LSTMSequenceTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
||||||
const auto &info = input.second;
|
const auto &info = input.second;
|
||||||
auto blob = GenerateInput(*info);
|
auto blob = GenerateInput(*info);
|
||||||
@ -104,14 +101,7 @@ namespace LayerTestsDefinitions {
|
|||||||
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
}
|
}
|
||||||
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) &&
|
|
||||||
configuration.count(InferenceEngine::PluginConfigParams::YES)) {
|
|
||||||
auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
|
|
||||||
inferRequest.SetBatch(batchSize);
|
|
||||||
}
|
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
} // namespace LayerTestsDefinitions
|
} // namespace LayerTestsDefinitions
|
||||||
|
@ -37,10 +37,7 @@ std::string NmsLayerTest::getTestCaseName(testing::TestParamInfo<NmsParams> obj)
|
|||||||
return result.str();
|
return result.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NmsLayerTest::Infer() {
|
void NmsLayerTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
size_t it = 0;
|
size_t it = 0;
|
||||||
for (const auto &input : cnnNetwork.getInputsInfo()) {
|
for (const auto &input : cnnNetwork.getInputsInfo()) {
|
||||||
const auto &info = input.second;
|
const auto &info = input.second;
|
||||||
@ -53,11 +50,9 @@ void NmsLayerTest::Infer() {
|
|||||||
} else {
|
} else {
|
||||||
blob = GenerateInput(*info);
|
blob = GenerateInput(*info);
|
||||||
}
|
}
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NmsLayerTest::Compare(const std::vector<std::vector<std::uint8_t>> &expectedOutputs, const std::vector<Blob::Ptr> &actualOutputs) {
|
void NmsLayerTest::Compare(const std::vector<std::vector<std::uint8_t>> &expectedOutputs, const std::vector<Blob::Ptr> &actualOutputs) {
|
||||||
|
@ -77,10 +77,7 @@ static void fillROITensor(float* buffer, int numROIs, int batchSize,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSROIPoolingLayerTest::Infer() {
|
void PSROIPoolingLayerTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
auto inputShape = cnnNetwork.getInputShapes().begin()->second;
|
auto inputShape = cnnNetwork.getInputShapes().begin()->second;
|
||||||
|
|
||||||
size_t it = 0;
|
size_t it = 0;
|
||||||
@ -97,11 +94,9 @@ void PSROIPoolingLayerTest::Infer() {
|
|||||||
} else {
|
} else {
|
||||||
blob = GenerateInput(*info);
|
blob = GenerateInput(*info);
|
||||||
}
|
}
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSROIPoolingLayerTest::SetUp() {
|
void PSROIPoolingLayerTest::SetUp() {
|
||||||
|
@ -91,10 +91,7 @@ namespace LayerTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RNNSequenceTest::Infer() {
|
void RNNSequenceTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
for (const auto &input : executableNetwork.GetInputsInfo()) {
|
||||||
const auto &info = input.second;
|
const auto &info = input.second;
|
||||||
auto blob = GenerateInput(*info);
|
auto blob = GenerateInput(*info);
|
||||||
@ -102,14 +99,7 @@ namespace LayerTestsDefinitions {
|
|||||||
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
blob = FuncTestUtils::createAndFillBlob(info->getTensorDesc(), m_max_seq_len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
}
|
}
|
||||||
if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) &&
|
|
||||||
configuration.count(InferenceEngine::PluginConfigParams::YES)) {
|
|
||||||
auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2;
|
|
||||||
inferRequest.SetBatch(batchSize);
|
|
||||||
}
|
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
} // namespace LayerTestsDefinitions
|
} // namespace LayerTestsDefinitions
|
||||||
|
@ -74,20 +74,6 @@ static void fillIdxTensor(std::vector<int> & idx, int batchSize) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROIAlignLayerTest::Infer() {
|
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
auto inputShape = cnnNetwork.getInputShapes().begin()->second;
|
|
||||||
for (const auto &input : cnnNetwork.getInputsInfo()) {
|
|
||||||
const auto &info = input.second;
|
|
||||||
Blob::Ptr blob;
|
|
||||||
blob = GenerateInput(*info);
|
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
|
||||||
}
|
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ROIAlignLayerTest::SetUp() {
|
void ROIAlignLayerTest::SetUp() {
|
||||||
std::vector<size_t> inputShape;
|
std::vector<size_t> inputShape;
|
||||||
std::vector<size_t> coordsShape;
|
std::vector<size_t> coordsShape;
|
||||||
|
@ -36,10 +36,7 @@ namespace LayerTestsDefinitions {
|
|||||||
return result.str();
|
return result.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROIPoolingLayerTest::Infer() {
|
void ROIPoolingLayerTest::GenerateInputs() {
|
||||||
inferRequest = executableNetwork.CreateInferRequest();
|
|
||||||
inputs.clear();
|
|
||||||
|
|
||||||
auto feat_map_shape = cnnNetwork.getInputShapes().begin()->second;
|
auto feat_map_shape = cnnNetwork.getInputShapes().begin()->second;
|
||||||
|
|
||||||
const auto is_roi_max_mode = (pool_method == ngraph::helpers::ROIPoolingTypes::ROI_MAX);
|
const auto is_roi_max_mode = (pool_method == ngraph::helpers::ROIPoolingTypes::ROI_MAX);
|
||||||
@ -60,11 +57,9 @@ namespace LayerTestsDefinitions {
|
|||||||
} else {
|
} else {
|
||||||
blob = GenerateInput(*info);
|
blob = GenerateInput(*info);
|
||||||
}
|
}
|
||||||
inferRequest.SetBlob(info->name(), blob);
|
|
||||||
inputs.push_back(blob);
|
inputs.push_back(blob);
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
inferRequest.Infer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROIPoolingLayerTest::SetUp() {
|
void ROIPoolingLayerTest::SetUp() {
|
||||||
|
@ -105,6 +105,7 @@ void Basic_LSTM_S::Run() {
|
|||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||||
|
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
const auto& actualOutputs = GetOutputs();
|
const auto& actualOutputs = GetOutputs();
|
||||||
|
@ -115,6 +115,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
switchToNgraphFriendlyModel();
|
switchToNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
|
@ -63,6 +63,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||||
|
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
switchToNgraphFriendlyModel();
|
switchToNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
|
@ -265,6 +265,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
switchToNgraphFriendlyModel();
|
switchToNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
@ -303,6 +304,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
CreatePureTensorIteratorModel();
|
CreatePureTensorIteratorModel();
|
||||||
|
@ -128,6 +128,7 @@ void MemoryEltwiseReshapeConcatTest::Run() {
|
|||||||
memory_init.data(), memory_init.size());
|
memory_init.data(), memory_init.size());
|
||||||
states[0].SetState(state_values_blob);
|
states[0].SetState(state_values_blob);
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
initNgraphFriendlyModel();
|
initNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
|
@ -414,6 +414,7 @@ void MultipleLSTMCellTest::Run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
switchToNgraphFriendlyModel();
|
switchToNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
@ -464,6 +465,7 @@ void MultipleLSTMCellTest::RunLowLatency(bool regular_api) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
// Calculate ref values for Unrolled TI
|
// Calculate ref values for Unrolled TI
|
||||||
|
@ -85,6 +85,7 @@ namespace SubgraphTestsDefinitions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IE_SUPPRESS_DEPRECATED_END
|
IE_SUPPRESS_DEPRECATED_END
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
switchToNgraphFriendlyModel();
|
switchToNgraphFriendlyModel();
|
||||||
Validate();
|
Validate();
|
||||||
|
@ -48,6 +48,7 @@ void SoftsignTest::Run() {
|
|||||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||||
|
|
||||||
LoadNetwork();
|
LoadNetwork();
|
||||||
|
GenerateInputs();
|
||||||
Infer();
|
Infer();
|
||||||
|
|
||||||
function = GenerateNgraphFriendlySoftSign();
|
function = GenerateNgraphFriendlySoftSign();
|
||||||
|
Loading…
Reference in New Issue
Block a user