def batch_size(self):
return self.impl.getBatch()
- ## \note This property is deprecated:
- # network precision does not make sense, use precision on edges.
- #
- # Precision of the network
- @property
- def precision(self):
- warnings.warn("Network precision is deprecated "
- "because it does not make sence, "
- "use precision on egdes.",
- DeprecationWarning)
- return self.impl.precision.decode()
-
@batch_size.setter
def batch_size(self, batch: int):
if batch <= 0:
actual = std::make_shared<InferenceEngine::CNNNetwork>(net);
name = actual->getName();
batch_size = actual->getBatchSize();
- IE_SUPPRESS_DEPRECATED_START
- precision = actual->getPrecision().name();
- IE_SUPPRESS_DEPRECATED_END
}
InferenceEnginePython::IENetwork::IENetwork(const std::shared_ptr<InferenceEngine::CNNNetwork> &cnn_network)
if (actual == nullptr) THROW_IE_EXCEPTION << "IENetwork was not initialized.";
name = actual->getName();
batch_size = actual->getBatchSize();
- IE_SUPPRESS_DEPRECATED_START
- precision = actual->getPrecision().name();
- IE_SUPPRESS_DEPRECATED_END
}
InferenceEnginePython::IENetwork::IENetwork(PyObject* network) {
actual = std::make_shared<InferenceEngine::CNNNetwork>(cnnNetwork);
name = actual->getName();
batch_size = actual->getBatchSize();
- IE_SUPPRESS_DEPRECATED_START
- precision = actual->getPrecision().name();
- IE_SUPPRESS_DEPRECATED_END
}
void
IE_SUPPRESS_DEPRECATED_END
actual = std::make_shared<InferenceEngine::CNNNetwork>(net);
batch_size = actual->getBatchSize();
- IE_SUPPRESS_DEPRECATED_START
- precision = actual->getPrecision().name();
- IE_SUPPRESS_DEPRECATED_END
}
void InferenceEnginePython::IENetwork::serialize(const std::string &path_to_xml, const std::string &path_to_bin) {
std::shared_ptr<InferenceEngine::CNNNetwork> actual;
std::string name;
std::size_t batch_size;
- std::string precision;
PyObject* getFunction();
void setBatch(const size_t size);
virtual ~CNNNetwork() {}
/**
- * @deprecated Network precision does not make sence, use precision on egdes. The method will be removed in 2021.1
- * @copybrief ICNNNetwork::getPrecision
- *
- * Wraps ICNNNetwork::getPrecision
- *
- * @return A precision type
- */
- INFERENCE_ENGINE_DEPRECATED("Network precision does not make sence, use precision on egdes. The method will be removed in 2021.1")
- virtual Precision getPrecision() const;
-
- /**
* @copybrief ICNNNetwork::getOutputsInfo
*
* Wraps ICNNNetwork::getOutputsInfo
}
/**
- * @deprecated Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph.
- * This method will be removed in 2021.1 release.
- * @copybrief IExecutableNetwork::GetMappedTopology
- *
- * Wraps IExecutableNetwork::GetMappedTopology.
- * @param deployedTopology Map of PrimitiveInfo objects that represent the deployed topology
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph")
- void GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>>& deployedTopology) {
- CALL_STATUS_FNC(GetMappedTopology, deployedTopology);
- }
- IE_SUPPRESS_DEPRECATED_END
-
- /**
* @brief cast operator is used when this wrapper initialized by LoadNetwork
* @return A shared pointer to IExecutableNetwork interface.
*/
*/
std::map<std::string, Version> GetVersions(const std::string& deviceName) const;
- /**
- * @deprecated IErrorListener is not used anymore. An exception is thrown in case of any unexpected situations.
- * The function will be removed in 2021.1 release.
- * @brief Sets logging callback
- *
- * Logging is used to track what is going on inside the plugins, Inference Engine library
- *
- * @param listener Logging sink
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. An exception is thrown in case of any unexpected situations.")
- void SetLogCallback(IErrorListener& listener) const;
- IE_SUPPRESS_DEPRECATED_END
-
#ifdef ENABLE_UNICODE_PATH_SUPPORT
/**
* @brief Reads IR xml and bin files
+++ /dev/null
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-/**
- * @brief A header file for a plugin logging mechanism
- *
- * @file ie_error.hpp
- */
-#pragma once
-
-namespace InferenceEngine {
-/**
- * @deprecated IErrorListener is not used anymore. An exception is thrown / StatusCode set in case of any unexpected situations
- * The class will be removed in 2021.1 release.
- * @brief This class represents a custom error listener.
- */
-class
-INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. An exception is thrown / StatusCode set in case of any unexpected situations")
- IErrorListener {
-public:
- /**
- * @brief The plugin calls this method with a null terminated error message (in case of error)
- * @param msg Error message
- */
- virtual void onError(const char* msg) noexcept = 0;
-};
-} // namespace InferenceEngine
}
/**
- * @deprecated IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations
- * The method will be removed in 2021.1 release.
- * @brief Sets a log callback that is used to track what is going on inside
- *
- * @param listener Logging listener
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations")
- void SetLogCallback(InferenceEngine::IErrorListener& listener) noexcept override {
- actual->SetLogCallback(listener);
- }
- IE_SUPPRESS_DEPRECATED_END
-
- /**
* @brief Cleans the resources up
*/
void Unload() noexcept override {
}
/**
- * @brief IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations
- * The method will be removed in 2021.1 release.
- * @brief Sets a log callback that is used to track what is going on inside
- *
- * @param listener Logging listener
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations")
- void SetLogCallback(InferenceEngine::IErrorListener& listener) noexcept override {
- actual->SetLogCallback(listener);
- }
- IE_SUPPRESS_DEPRECATED_END
-
- /**
* @brief Cleans the resources up
*/
void Unload() noexcept override {
#include "ie_imemory_state.hpp"
#include "ie_input_info.hpp"
#include "ie_parameter.hpp"
-#include "ie_primitive_info.hpp"
#include "ie_remote_context.hpp"
namespace InferenceEngine {
virtual StatusCode Export(std::ostream& networkModel, ResponseDesc* resp) noexcept = 0;
/**
- * @deprecated Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph.
- * The method will be removed in 2021.1 release.
- * @brief Get the mapping of IR layer names to implemented kernels
- *
- * @param deployedTopology Map of PrimitiveInfo objects that represent the deployed topology
- * @param resp Optional: pointer to an already allocated object to contain information in case of failure
- * @return Status code of the operation: InferenceEngine::OK (0) for success
- */
- IE_SUPPRESS_DEPRECATED_START_WIN
- INFERENCE_ENGINE_DEPRECATED("Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph")
- virtual StatusCode GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>>& deployedTopology,
- ResponseDesc* resp) noexcept = 0;
- IE_SUPPRESS_DEPRECATED_END_WIN
-
- /**
* @brief Get executable graph information from a device
*
* @param graphPtr network ptr to store executable graph information
#include "details/ie_no_copy.hpp"
#include "ie_api.h"
-#include "ie_error.hpp"
#include "ie_common.h"
#include "ie_layouts.h"
#include "ie_blob.h"
class IShapeInferExtension : public InferenceEngine::details::IRelease {
public:
/**
- * @deprecated IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations
- * The method will be removed in 2021.1 release.
- * @brief Sets logging callback.
- *
- * Logging is used to track what is going on inside.
- *
- * @param listener Logging sink
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations")
- virtual void SetLogCallback(InferenceEngine::IErrorListener& listener) noexcept { (void)listener; }
- IE_SUPPRESS_DEPRECATED_END
-
- /**
* @brief Gets extension version information and stores in versionInfo
* @param versionInfo Pointer to version info, will be set by plugin
*/
#include "details/ie_no_copy.hpp"
#include "ie_api.h"
#include "ie_core.hpp"
-#include "ie_error.hpp"
#include "ie_iexecutable_network.hpp"
#include "ie_version.hpp"
virtual void GetVersion(const Version*& versionInfo) noexcept = 0;
/**
- * @deprecated IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations
- * This API will be removed in 2021.1 release.
- * @brief Sets logging callback
- *
- * Logging is used to track what is going on inside
- * @param listener Logging sink
- */
- IE_SUPPRESS_DEPRECATED_START
- INFERENCE_ENGINE_DEPRECATED("IErrorListener is not used anymore. StatusCode is provided in case of unexpected situations")
- virtual void SetLogCallback(IErrorListener& listener) noexcept = 0;
- IE_SUPPRESS_DEPRECATED_END
-
- /**
* @brief Creates an executable network from a network object. User can create as many networks as they need and use
* them simultaneously (up to the limitation of the hardware resources)
*
+++ /dev/null
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-/**
- * @brief A header file for the PrimitiveInfo struct
- *
- * @file ie_primitive_info.hpp
- */
-
-#pragma once
-
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "ie_tensor_info.hpp"
-
-namespace InferenceEngine {
-
-/**
- * @deprecated Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph.
- * This structure will be removed in 2021.1 release.
- * @brief Structure with information about Primitive
- */
-struct INFERENCE_ENGINE_DEPRECATED("Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph") PrimitiveInfo {
- /**
- * @brief A shared pointer to PrimitiveInfo object
- */
- IE_SUPPRESS_DEPRECATED_START
- using Ptr = std::shared_ptr<PrimitiveInfo>;
- IE_SUPPRESS_DEPRECATED_END
-
- /**
- * @brief Some internal id, could be used as a name
- */
- std::string sId;
-
- /**
- * @brief Implementation type of this kernel
- */
- std::string sType;
-
- /**
- * @brief Mainly the allocation of the output tensor
- */
- int iPreAllocatedMemory;
-
- IE_SUPPRESS_DEPRECATED_START
-
- /**
- * @brief Vector of TensorInfo objects that are related to input tensors
- */
- std::vector<TensorInfo::Ptr> inputs;
-
- /**
- * @brief Vector of TensorInfo object that are related to outputs tensors
- */
- std::vector<TensorInfo::Ptr> outputs;
-
- IE_SUPPRESS_DEPRECATED_END
-
- /**
- * @brief Any other important textual information user might find interesting about this kernel
- */
- std::map<std::string, std::string> extraInfo;
-};
-
-} // namespace InferenceEngine
+++ /dev/null
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-/**
- * @brief A header file for the TensorInfo structure
- *
- * @file ie_tensor_info.hpp
- */
-
-#pragma once
-
-#include <map>
-#include <memory>
-#include <string>
-
-#include <ie_api.h>
-
-namespace InferenceEngine {
-
-/**
- * @deprecated Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph.
- * This API will be removed in 2021.1 release.
- * @struct TensorInfo
- * @brief This structure describes tensor information
- */
-struct INFERENCE_ENGINE_DEPRECATED("Use ExecutableNetwork::GetExecGraphInfo to get information about an internal graph") TensorInfo {
- /**
- * @brief A shared pointer to the TensorInfo object
- */
- IE_SUPPRESS_DEPRECATED_START
- using Ptr = std::shared_ptr<TensorInfo>;
- IE_SUPPRESS_DEPRECATED_END
-
- /**
- * @brief A map of extra info:
- * - memory layout BFYX, BXYF (enum)
- * - size
- * - precision
- */
- std::map<std::string, std::string> extraInfo;
-};
-
-} // namespace InferenceEngine
#include <cpp/ie_executable_network.hpp>
#include <cpp/ie_plugin_cpp.hpp>
#include <ie_core.hpp>
-#include <ie_error.hpp>
#include <ie_icnn_network.hpp>
#include <ie_icnn_network_stats.hpp>
#include <ie_plugin_config.hpp>
return versions;
}
-IE_SUPPRESS_DEPRECATED_START
-void Core::SetLogCallback(IErrorListener&) const {
-}
-IE_SUPPRESS_DEPRECATED_END
-
CNNNetwork Core::ReadNetwork(const std::string& modelPath, const std::string& binPath) const {
return _impl->ReadNetwork(modelPath, binPath);
}
namespace InferenceEngine {
-Precision CNNNetwork::getPrecision() const {
- if (actual == nullptr) THROW_IE_EXCEPTION << "CNNNetwork was not initialized.";
- return actual->getPrecision();
-}
-
CNNLayerPtr CNNNetwork::getLayerByName(const char* layerName) const {
CNNLayerPtr layer;
CALL_STATUS_FNC(getLayerByName, layerName, layer);
TO_STATUS(_impl->Export(networkModel));
}
- IE_SUPPRESS_DEPRECATED_START
- StatusCode GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>>& deployedTopology,
- ResponseDesc* resp) noexcept override {
- return NOT_IMPLEMENTED;
- }
- IE_SUPPRESS_DEPRECATED_END
-
StatusCode GetExecGraphInfo(ICNNNetwork::Ptr& graphPtr, ResponseDesc* resp) noexcept override {
TO_STATUS(_impl->GetExecGraphInfo(graphPtr));
}
versionInfo = &_version;
}
- IE_SUPPRESS_DEPRECATED_START
- void SetLogCallback(IErrorListener& listener) noexcept override {
- (void)listener;
- }
- IE_SUPPRESS_DEPRECATED_END
-
StatusCode LoadNetwork(IExecutableNetwork::Ptr& executableNetwork, const ICNNNetwork& network,
const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept override {
TO_STATUS(_impl->LoadNetwork(executableNetwork, network, config));
ASSERT_THROW(CNNNetwork network(nlptr), InferenceEngine::details::InferenceEngineException);
}
-TEST_F(CNNNetworkTests, throwsOnUninitializedGetPrecision) {
- CNNNetwork network;
- IE_SUPPRESS_DEPRECATED_START
- ASSERT_THROW(network.getPrecision(), InferenceEngine::details::InferenceEngineException);
- IE_SUPPRESS_DEPRECATED_END
-}
-
TEST_F(CNNNetworkTests, throwsOnUninitializedGetOutputsInfo) {
CNNNetwork network;
ASSERT_THROW(network.getOutputsInfo(), InferenceEngine::details::InferenceEngineException);
public:
TestExtension() = default;
void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override;
- IE_SUPPRESS_DEPRECATED_START
- void SetLogCallback(InferenceEngine::IErrorListener& /*listener*/) noexcept override {}
- IE_SUPPRESS_DEPRECATED_END
void Unload() noexcept override {}
void Release() noexcept override {
delete this;
//
#include "unit_test_utils/mocks/mock_allocator.hpp"
-#include "unit_test_utils/mocks/mock_error_listener.hpp"
#include "unit_test_utils/mocks/mock_icnn_network.hpp"
#include "unit_test_utils/mocks/mock_ie_imemory_state.hpp"
#include "unit_test_utils/mocks/mock_iexecutable_network.hpp"
MOCK_METHOD1(setNetworkOutputs, void(OutputsDataMap));
MOCK_METHOD1(CreateInferRequest, void(IInferRequest::Ptr &));
MOCK_METHOD1(Export, void(const std::string &));
- MOCK_METHOD1(GetMappedTopology, void(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &));
MOCK_METHOD1(GetExecGraphInfo, void(ICNNNetwork::Ptr &));
void WrapOstreamExport(std::ostream& networkModel) {
ExecutableNetworkInternal::Export(networkModel);
AsyncInferRequestInternal::Ptr(InputsDataMap networkInputs, OutputsDataMap networkOutputs));
MOCK_METHOD1(Export, void(const std::string &));
void Export(std::ostream&) override {}
- MOCK_METHOD1(GetMappedTopology, void(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &));
};
IE_SUPPRESS_DEPRECATED_END
std::shared_ptr<InferRequestInternal>(InputsDataMap networkInputs, OutputsDataMap networkOutputs));
MOCK_METHOD1(Export, void(const std::string &));
void Export(std::ostream &) override {}
- MOCK_METHOD1(GetMappedTopology, void(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &));
};
IE_SUPPRESS_DEPRECATED_END
MOCK_METHOD1(CreateInferRequest, void(IInferRequest::Ptr &));
MOCK_METHOD1(Export, void(const std::string &));
void Export(std::ostream &) override {};
- MOCK_METHOD1(GetMappedTopology, void(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &));
MOCK_METHOD0(QueryState, std::vector<IMemoryStateInternal::Ptr>());
MOCK_METHOD1(GetExecGraphInfo, void(ICNNNetwork::Ptr &));
}
MOCK_METHOD1(AddExtension, void(InferenceEngine::IExtensionPtr ext_ptr));
MOCK_METHOD1(SetConfig, void(const std::map <std::string, std::string> &));
- IE_SUPPRESS_DEPRECATED_START
- MOCK_METHOD1(SetLogCallback, void(InferenceEngine::IErrorListener &));
- IE_SUPPRESS_DEPRECATED_END
MOCK_METHOD2(ImportNetwork, InferenceEngine::IExecutableNetwork::Ptr(const std::string &, const std::map<std::string, std::string> &));
InferenceEngine::ExecutableNetwork ImportNetwork(const std::istream&, const std::map<std::string, std::string> &) {return {};}
MOCK_QUALIFIED_METHOD0(GetName, const noexcept, std::string(void));
delete this;
}
-void MockPlugin::SetLogCallback(InferenceEngine::IErrorListener &listener) noexcept {
- IF_NOT_NULL(SetLogCallback(listener));
-}
-
void MockPlugin::GetVersion(const Version *&versionInfo) noexcept {
versionInfo = &version;
}
explicit MockPlugin(InferenceEngine::IInferencePlugin*target);
void GetVersion(const InferenceEngine::Version *& versionInfo) noexcept override;
- void SetLogCallback(InferenceEngine::IErrorListener& listener) noexcept override;
InferenceEngine::StatusCode AddExtension(InferenceEngine::IExtensionPtr extension, InferenceEngine::ResponseDesc *resp) noexcept override;
+++ /dev/null
-// Copyright (C) 2018-2020 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#pragma once
-
-#include <gmock/gmock.h>
-#include <ie_error.hpp>
-
-IE_SUPPRESS_DEPRECATED_START
-
-class Listener : public InferenceEngine::IErrorListener {
-public:
- MOCK_QUALIFIED_METHOD1(onError, noexcept, void(const char * err));
-};
-
-IE_SUPPRESS_DEPRECATED_END
MOCK_QUALIFIED_METHOD2(CreateInferRequest, noexcept, StatusCode(IInferRequest::Ptr &, ResponseDesc*));
MOCK_QUALIFIED_METHOD2(Export, noexcept, StatusCode(const std::string &, ResponseDesc*));
MOCK_QUALIFIED_METHOD2(Export, noexcept, StatusCode(std::ostream &, ResponseDesc *));
- MOCK_QUALIFIED_METHOD2(GetMappedTopology, noexcept, StatusCode(std::map<std::string, std::vector<PrimitiveInfo::Ptr>> &, ResponseDesc*));
MOCK_QUALIFIED_METHOD2(GetExecGraphInfo, noexcept, StatusCode(ICNNNetwork::Ptr &, ResponseDesc*));
MOCK_QUALIFIED_METHOD2(SetConfig, noexcept, StatusCode(const std::map<std::string, Parameter> &config, ResponseDesc *resp));
MOCK_QUALIFIED_METHOD3(GetConfig, const noexcept, StatusCode(const std::string &name, Parameter &result, ResponseDesc *resp));
InferenceEngine::ResponseDesc *resp));
MOCK_QUALIFIED_METHOD1(GetVersion, noexcept, void(const InferenceEngine::Version *&));
MOCK_QUALIFIED_METHOD0(Release, noexcept, void());
- MOCK_QUALIFIED_METHOD1(SetLogCallback, noexcept, void(InferenceEngine::IErrorListener &));
MOCK_QUALIFIED_METHOD2(LoadNetwork, noexcept, InferenceEngine::StatusCode(
const InferenceEngine::ICNNNetwork &, InferenceEngine::ResponseDesc *resp));
MOCK_QUALIFIED_METHOD4(LoadNetwork, noexcept, InferenceEngine::StatusCode(
using Ptr = std::shared_ptr<MockShapeInferExtension>;
MOCK_QUALIFIED_METHOD1(GetVersion, const noexcept, void(const InferenceEngine::Version *&));
MOCK_QUALIFIED_METHOD0(Release, noexcept, void());
- MOCK_QUALIFIED_METHOD1(SetLogCallback, noexcept, void(InferenceEngine::IErrorListener &));
MOCK_QUALIFIED_METHOD0(Unload, noexcept, void());
MOCK_QUALIFIED_METHOD3(getShapeInferTypes, noexcept, InferenceEngine::StatusCode
// TODO: add tests for the next methods:
// 1. void Export(const std::string& modelFileName)
// 2. void Export(std::ostream& networkModel)
-// 3. void GetMappedTopology(std::map<std::string, std::vector<PrimitiveInfo::Ptr>>& deployedTopology)
// 4. CNNNetwork GetExecGraphInfo()
// 5. void SetConfig(const std::map<std::string, Parameter>& config)
// 6. Parameter GetConfig(const std::string& name) const
#include "details/ie_so_loader.h"
#include "unit_test_utils/mocks/mock_engine/mock_plugin.hpp"
-#include "unit_test_utils/mocks/mock_error_listener.hpp"
#include "unit_test_utils/mocks/mock_iinference_plugin.hpp"
}
MockIInferencePlugin engine;
- Listener error;
};
TEST_F(PluginTest, canCreatePlugin) {
unique_ptr<IInferencePlugin, std::function<void(IInferencePlugin*)>> smart_ptr(ptr(nullptr), [](IInferencePlugin *p) {
p->Release();
});
-
- //expect that no error handler has been called
- smart_ptr->SetLogCallback(error);
- EXPECT_CALL(error, onError(_)).Times(0);
}
TEST_F(PluginTest, canCreatePluginUsingSmartPtr) {
EXPECT_THROW(InferenceEnginePluginPtr("unknown_plugin"), InferenceEngineException);
}
-ACTION_TEMPLATE(CallListenerWithErrorMessage,
- HAS_1_TEMPLATE_PARAMS(int, k),
- AND_1_VALUE_PARAMS(pointer)) {
- InferenceEngine::IErrorListener & data = ::std::get<k>(args);
- data.onError(pointer);
-}
-
InferenceEnginePluginPtr PluginTest::getPtr() {
InferenceEnginePluginPtr smart_ptr(get_mock_engine_name());
return smart_ptr;
versionInfo = &VERSION;
}
- void SetLogCallback(InferenceEngine::IErrorListener &listener) noexcept override {}
-
void Unload() noexcept override {}
std::vector<std::string> getImplTypes(const std::shared_ptr<ngraph::Node>& node) override {
}
//
-// LogCallBack
-//
-
-TEST_F(IEClassBasicTest, smoke_LogCallBackNoThrow) {
- Core ie;
-
- IE_SUPPRESS_DEPRECATED_START
- class ConsoleErrorListener : public IErrorListener {
- void onError(const char *msg) noexcept override {
- std::clog << "Plugin message: " << msg << std::endl;
- }
- };
-
- ConsoleErrorListener listener;
-
- ASSERT_NO_THROW(ie.SetLogCallback(listener));
- IE_SUPPRESS_DEPRECATED_END
-}
-
-//
// ImportNetwork
//
std::string getName() const override;
bool transform(CNNNetwork& network, LayerTransformation::Params& params) const override;
std::string getModel(SingleLayerTransformationsTestParams& p) const override;
+
+ mutable InferenceEngine::Precision netPrecision;
};
class PowerTestModel : public SingleLayerTestModel {
std::string PoolingTestModel::getModel(SingleLayerTransformationsTestParams& p) const {
size_t type_size = sizeof(InferenceEngine::PrecisionTrait<InferenceEngine::Precision::FP32>::value_type);
- if (p._network_precision == "FP16")
+ netPrecision = Precision::FP32;
+
+ // TODO: don't use network precision
+ if (p._network_precision == "FP16") {
+ netPrecision = Precision::FP16;
type_size = sizeof(InferenceEngine::PrecisionTrait<InferenceEngine::Precision::FP16>::value_type);
+ }
CommonTestUtils::pool_common_params pooling = { {1, 1}, {1, 1}, {0, 0}, {0, 0}, "valid", false, true };
std::vector<size_t> poolOutShape(p.inputDimensions[0].size());
LowPrecisionTransformer transformer(LowPrecisionTransformer::getAllTransformations(params));
transformer.transform(network);
- const Precision precision = params.updatePrecisions ? Precision(Precision::U8) : network.getPrecision();
+ // TODO: don't use network precision
+ const Precision precision = params.updatePrecisions ? Precision(Precision::U8) : netPrecision;
CNNLayerPtr fakeQuantize = getLayer(network, "FakeQuantize6");
if (fakeQuantize->outData[0]->getPrecision() != precision) {
LowPrecisionTransformer transformer(LowPrecisionTransformer::getAllTransformations(params));
transformer.transform(network);
- const Precision precision = params.updatePrecisions ? Precision(Precision::U8) : network.getPrecision();
+ const Precision precision = params.updatePrecisions ? Precision(Precision::U8) :
+ network.getInputsInfo().begin()->second->getPrecision();
CNNLayerPtr fakeQuantize = getLayer(network, "FakeQuantize6");
if (fakeQuantize->outData[0]->getPrecision() != precision) {
TBlob<uint8_t>::Ptr SingleLayerTransformationsTest::generateWeights(const CNNNetwork& network) {
std::vector<Blob::Ptr> blobs;
- const auto net_precision = network.getPrecision();
+ const auto net_precision = network.getInputsInfo().begin()->second->getPrecision();
std::vector<CNNLayerPtr> sortedLayers = CNNNetSortTopologically(network);
for (CNNLayerPtr layer : sortedLayers) {
const auto transformedOutput = infer(network, inputBlobs, core, p.device_name, executableNetworkTransformed, inferRequestTransformed);
//compareInDetails(originalOutputMap, *transformedOutput, 70, 0.5);
- auto net_precision = network.getPrecision();
+ auto net_precision = network.getInputsInfo().begin()->second->getPrecision();
for (auto& originalOutput : originalOutputMap) {
const auto& name = originalOutput.first;
const auto outSize = originalOutput.second->size();
}
void GetVersion(const InferenceEngine::Version *&versionInfo) const noexcept override {}
- void SetLogCallback(InferenceEngine::IErrorListener &listener) noexcept override {}
void Unload() noexcept override {}
void Release() noexcept override {
delete this;
#include <ie_plugin_config.hpp>
#include "tests_common.hpp"
-#include "unit_test_utils/mocks/mock_error_listener.hpp"
-
using namespace ::testing;
using namespace std;
using namespace mkldnn;
#include "tests_common.hpp"
#include <ie_core.hpp>
-#include "unit_test_utils/mocks/mock_error_listener.hpp"
-
using namespace ::testing;
using namespace std;
using namespace mkldnn;