// SPDX-License-Identifier: Apache-2.0
//
-#include <transformations/convert_batch_to_space.hpp>
-#include <transformations/convert_space_to_batch.hpp>
+#include <transformations/op_conversions/convert_batch_to_space.hpp>
+#include <transformations/op_conversions/convert_space_to_batch.hpp>
#include "layer_test_utils.hpp"
+#include "plugin_config.hpp"
namespace LayerTestsUtils {
void LayerTestsCommon::Run() {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
- ConfigurePlugin();
LoadNetwork();
Infer();
Validate();
}
-LayerTestsCommon::~LayerTestsCommon() {
- if (!configuration.empty()) {
- PluginCache::get().reset();
- }
-}
-
InferenceEngine::Blob::Ptr LayerTestsCommon::GenerateInput(const InferenceEngine::InputInfo &info) const {
return FuncTestUtils::createAndFillBlob(info.getTensorDesc());
}
const auto actualBuffer = lockedMemory.as<const std::uint8_t *>();
const auto &precision = actual->getTensorDesc().getPrecision();
- auto bufferSize = actual->size();
- // With dynamic batch, you need to size
- if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED)) {
- auto batchSize = actual->getTensorDesc().getDims()[0];
- auto halfBatchSize = batchSize > 1 ? batchSize/ 2 : 1;
- bufferSize = (actual->size() * halfBatchSize / batchSize);
- }
- const auto &size = bufferSize;
+ const auto &size = actual->size();
switch (precision) {
case InferenceEngine::Precision::FP32:
Compare(reinterpret_cast<const float *>(expectedBuffer), reinterpret_cast<const float *>(actualBuffer),
}
}
-void LayerTestsCommon::ConfigurePlugin() {
- if (!configuration.empty()) {
- core->SetConfig(configuration, targetDevice);
- }
-}
-
void LayerTestsCommon::ConfigureNetwork() const {
for (const auto &in : cnnNetwork.getInputsInfo()) {
if (inLayout != InferenceEngine::Layout::ANY) {
void LayerTestsCommon::LoadNetwork() {
cnnNetwork = InferenceEngine::CNNNetwork{function};
+ PreparePluginConfiguration(this);
ConfigureNetwork();
- executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice);
+ executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice, configuration);
}
void LayerTestsCommon::Infer() {
void LayerTestsCommon::SetRefMode(RefMode mode) {
refMode = mode;
}
+
+std::shared_ptr<ngraph::Function> LayerTestsCommon::GetFunction() {
+ return function;
+}
+
+std::map<std::string, std::string>& LayerTestsCommon::GetConfiguration() {
+ return configuration;
+}
} // namespace LayerTestsUtils